home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Controls.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  93.4 KB  |  2,382 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Controls.a
  3. ;
  4. ;    Contains:    Control Manager interfaces
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  18. __CONTROLS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  24.     include 'Quickdraw.a'
  25.     ENDIF
  26.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  27.     include 'Menus.a'
  28.     ENDIF
  29.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  30.     include 'TextEdit.a'
  31.     ENDIF
  32.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  33.     include 'Drag.a'
  34.     ENDIF
  35.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  36.     include 'Icons.a'
  37.     ENDIF
  38.  
  39.  
  40. _ControlDispatch                EQU        $AA73
  41. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  42. ;     • Gestalt                                                                                            
  43. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  44.  
  45. gestaltControlMgrAttr            EQU        'cntl'
  46. gestaltControlMgrPresent        EQU        $00000001
  47. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  48. ;     • Resource Types                                                                                    
  49. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  50.  
  51. kControlDefProcType                EQU        'CDEF'
  52. kControlTemplateResourceType    EQU        'CNTL'
  53. kControlColorTableResourceType    EQU        'cctb'
  54. kControlDefProcResourceType        EQU        'CDEF'
  55. kControlTabListResType            EQU        'tab#'                ; used for tab control (Appearance 1.0 and later)
  56. kControlListDescResType            EQU        'ldes'                ; used for list box control (Appearance 1.0 and later)
  57. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  58. ;     • Format of a ‘CNTL’ resource                                                                        
  59. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  60. ControlTemplate            RECORD 0
  61. controlRect                 ds        Rect            ; offset: $0 (0)
  62. controlValue             ds.w    1                ; offset: $8 (8)
  63. controlVisible             ds.b    1                ; offset: $A (10)
  64. fill                     ds.b    1                ; offset: $B (11)
  65. controlMaximum             ds.w    1                ; offset: $C (12)
  66. controlMinimum             ds.w    1                ; offset: $E (14)
  67. controlDefProcID         ds.w    1                ; offset: $10 (16)
  68. controlReference         ds.l    1                ; offset: $12 (18)
  69. controlTitle             ds        Str255            ; offset: $16 (22)
  70. sizeof                     EQU *                    ; size:   $116 (278)
  71.                         ENDR
  72. ; typedef struct ControlTemplate *        ControlTemplatePtr
  73.  
  74. ; typedef ControlTemplatePtr *            ControlTemplateHandle
  75.  
  76.  
  77.  
  78.     IF ¬ TARGET_OS_MAC THEN
  79.  
  80. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  81. ;   • NON-MAC COMPATIBILITY CODES (QuickTime 3.0)
  82. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  83.  
  84.  
  85. ; typedef UInt32                         ControlNotification
  86.  
  87.  
  88. controlNotifyNothing            EQU        'nada'                ; No (null) notification
  89. controlNotifyClick                EQU        'clik'                ; Control was clicked
  90. controlNotifyFocus                EQU        'focu'                ; Control got keyboard focus
  91. controlNotifyKey                EQU        'key '                ; Control got a keypress
  92. ; typedef UInt32                         ControlCapabilities
  93.  
  94.  
  95. kControlCanAutoInvalidate        EQU        $00000001            ; Control component automatically invalidates areas left behind after hide/move operation.
  96. ;  procID's for our added "controls"
  97.  
  98. staticTextProc                    EQU        256                    ; static text
  99. editTextProc                    EQU        272                    ; editable text
  100. iconProc                        EQU        288                    ; icon
  101. userItemProc                    EQU        304                    ; user drawn item
  102. pictItemProc                    EQU        320                    ; pict
  103.     ENDIF
  104. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  105. ;     • ControlHandle                                                                                        
  106. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  107.  
  108.  
  109. ; typedef ControlRecord *                ControlPtr
  110.  
  111. ; typedef ControlPtr *                    ControlHandle
  112.  
  113. ;  ControlRef is obsolete. Use ControlHandle.
  114. ; typedef ControlHandle                 ControlRef
  115.  
  116. ; typedef SInt16                         ControlPartCode
  117.  
  118. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  119. ;  • Control ActionProcPtr                                                                                
  120. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  121. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  122. ;     • ControlRecord                                                                                        
  123. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  124. ControlRecord            RECORD 0
  125. nextControl                 ds.l    1                ; offset: $0 (0)
  126. contrlOwner                 ds.l    1                ; offset: $4 (4)
  127. contrlRect                 ds        Rect            ; offset: $8 (8)
  128. contrlVis                 ds.b    1                ; offset: $10 (16)
  129. contrlHilite             ds.b    1                ; offset: $11 (17)
  130. contrlValue                 ds.w    1                ; offset: $12 (18)
  131. contrlMin                 ds.w    1                ; offset: $14 (20)
  132. contrlMax                 ds.w    1                ; offset: $16 (22)
  133. contrlDefProc             ds.l    1                ; offset: $18 (24)
  134. contrlData                 ds.l    1                ; offset: $1C (28)
  135. contrlAction             ds.l    1                ; offset: $20 (32)
  136. contrlRfCon                 ds.l    1                ; offset: $24 (36)
  137. contrlTitle                 ds        Str255            ; offset: $28 (40)
  138. sizeof                     EQU *                    ; size:   $128 (296)
  139.                         ENDR
  140. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  141. ;  • Control ActionProcPtr : Epilogue                                                                    
  142. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  143. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  144. ;     • Control Color Table                                                                                
  145. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  146.  
  147. cFrameColor                        EQU        0
  148. cBodyColor                        EQU        1
  149. cTextColor                        EQU        2
  150. cThumbColor                        EQU        3
  151. kNumberCtlCTabEntries            EQU        4
  152. CtlCTab                    RECORD 0
  153. ccSeed                     ds.l    1                ; offset: $0 (0)
  154. ccRider                     ds.w    1                ; offset: $4 (4)
  155. ctSize                     ds.w    1                ; offset: $6 (6)
  156. ctTable                     ds.b    4 * ColorSpec.sizeof ; offset: $8 (8)
  157. sizeof                     EQU *                    ; size:   $28 (40)
  158.                         ENDR
  159. ; typedef struct CtlCTab *                CCTabPtr
  160.  
  161. ; typedef CCTabPtr *                    CCTabHandle
  162.  
  163. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  164. ;     • Auxiliary Control Record                                                                            
  165. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  166. AuxCtlRec                RECORD 0
  167. acNext                     ds.l    1                ; offset: $0 (0)
  168. acOwner                     ds.l    1                ; offset: $4 (4)
  169. acCTable                 ds.l    1                ; offset: $8 (8)
  170. acFlags                     ds.w    1                ; offset: $C (12)
  171. acReserved                 ds.l    1                ; offset: $E (14)
  172. acRefCon                 ds.l    1                ; offset: $12 (18)
  173. sizeof                     EQU *                    ; size:   $16 (22)
  174.                         ENDR
  175. ; typedef struct AuxCtlRec *            AuxCtlPtr
  176.  
  177. ; typedef AuxCtlPtr *                    AuxCtlHandle
  178.  
  179. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  180. ;     • PopUp Menu Private Data Structure                                                                    
  181. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  182. PopupPrivateData        RECORD 0
  183. mHandle                     ds.l    1                ; offset: $0 (0)
  184. mID                         ds.w    1                ; offset: $4 (4)
  185. sizeof                     EQU *                    ; size:   $6 (6)
  186.                         ENDR
  187. ; typedef struct PopupPrivateData *        PopupPrivateDataPtr
  188.  
  189. ; typedef PopupPrivateDataPtr *            PopupPrivateDataHandle
  190.  
  191.  
  192. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  193. ;     • Errors are in the range -30580 .. -30599                                                            
  194. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  195.  
  196. errMessageNotSupported            EQU        -30580
  197. errDataNotSupported                EQU        -30581
  198. errControlDoesntSupportFocus    EQU        -30582
  199. errWindowDoesntSupportFocus        EQU        -30583
  200. errUnknownControl                EQU        -30584
  201. errCouldntSetFocus                EQU        -30585
  202. errNoRootControl                EQU        -30586
  203. errRootAlreadyExists            EQU        -30587
  204. errInvalidPartCode                EQU        -30588
  205. errControlsAlreadyExist            EQU        -30589
  206. errControlIsNotEmbedder            EQU        -30590
  207. errDataSizeMismatch                EQU        -30591
  208. errControlHiddenOrDisabled        EQU        -30592
  209. errWindowRegionCodeInvalid        EQU        -30593
  210. errCantEmbedIntoSelf            EQU        -30594
  211. errCantEmbedRoot                EQU        -30595
  212. errItemNotControl                EQU        -30596
  213. controlInvalidDataVersionErr    EQU        -30597
  214. controlPropertyInvalid            EQU        -5603
  215. controlPropertyNotFoundErr        EQU        -5604
  216. controlHandleInvalidErr            EQU        -30599
  217. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  218. ;     • Control Definition ID’s                                                                            
  219. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  220. ;  Standard System 7 procIDs
  221.  
  222.  
  223. pushButProc                        EQU        0
  224. checkBoxProc                    EQU        1
  225. radioButProc                    EQU        2
  226. scrollBarProc                    EQU        16
  227. popupMenuProc                    EQU        1008
  228.  
  229. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  230. ;     • Control Types and ID’s available only with Appearance 1.0 and later                                
  231. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  232.  
  233.  
  234. kControlSupportsNewMessages        EQU        ' ok '                ; CDEF should return as result of kControlMsgTestNewMsgSupport
  235. ;  focusing part codes 
  236.  
  237. kControlFocusNoPart                EQU        0                    ; tells control to clear its focus
  238. kControlFocusNextPart            EQU        -1                    ; tells control to focus on the next part
  239. kControlFocusPrevPart            EQU        -2                    ; tells control to focus on the previous part
  240. ; typedef SInt16                         ControlFocusPart
  241.  
  242. ;  Use this constant in Get/SetControlData when the data referred to is not            
  243. ;  specific to a part, but rather the entire control, e.g. the list handle of a     
  244. ;  list box control.                                                                
  245.  
  246. kControlEntireControl            EQU        0
  247. ;  Key Filter result codes                                                             
  248. ;                                                                                     
  249. ;  Certain controls can have a keyfilter attached to them. The filter proc should    
  250. ;  return one of the two constants below. If kKeyFilterBlockKey is returned, the    
  251. ;  key is blocked and never makes it to the control. If kKeyFilterPassKey is        
  252. ;  returned, the control receives the keystroke.                                    
  253.  
  254. kControlKeyFilterBlockKey        EQU        0
  255. kControlKeyFilterPassKey        EQU        1
  256. ; typedef SInt16                         ControlKeyFilterResult
  257.  
  258. ;  ControlKeyScriptBehavior                                                            
  259. ;                                                                                     
  260. ;  These are the values you can use with kControlEditTextKeyScriptBehaviorTag on an 
  261. ;  Edit Text control.                                                                
  262. ;  The default for password fields is kControlKeyScriptBehaviorPrefersRoman, while    
  263. ;  non password fields default to kControlKeyScriptBehaviorAllowAnyScript.            
  264.  
  265. kControlKeyScriptBehaviorAllowAnyScript EQU 'any '            ; leaves the current keyboard alone and allows user to change the keyboard.
  266. kControlKeyScriptBehaviorPrefersRoman EQU 'prmn'            ; switches the keyboard to roman, but allows them to change it as desired.
  267. kControlKeyScriptBehaviorRequiresRoman EQU 'rrmn'            ; switches the keyboard to roman and prevents the user from changing it.
  268. ; typedef UInt32                         ControlKeyScriptBehavior
  269.  
  270. ; ——————————————————————————————————————————————————————————————————————————————————————
  271. ;      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  272. ;    The constants below are meta-font numbers which you can use to set a particular
  273. ;    control's font usage. There are essentially two modes you can use: 1) default,
  274. ;    which is essentially the same as it always has been, i.e. it uses the system font, unless
  275. ;    directed to use the window font via a control variant. 2) you can specify to use
  276. ;    the big or small system font in a generic manner. The Big system font is the font
  277. ;    used in menus, etc. Chicago has filled that role for some time now. Small system
  278. ;    font is currently Geneva 10. The meta-font number implies the size and style.
  279. ;
  280. ;    NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  281. ;                the fore and back color (Static Text is the only one that does, for
  282. ;                backwards compatibility). Also size, face, and addFontSize are ignored
  283. ;                when using the meta-font numbering.
  284. ;
  285.  
  286. ; ——————————————————————————————————————————————————————————————————————————————————————
  287.  
  288.                                                             ; Meta-font numbering - see not above 
  289. kControlFontBigSystemFont        EQU        -1                    ; force to big system font
  290. kControlFontSmallSystemFont        EQU        -2                    ; force to small system font
  291. kControlFontSmallBoldSystemFont    EQU        -3                    ; force to small bold system font
  292. ;  Add these masks together to set the flags field of a ControlFontStyleRec    
  293. ;  They specify which fields to apply to the text. It is important to make    
  294. ;  sure that you specify only the fields that you wish to set.                
  295.  
  296. kControlUseFontMask                EQU        $0001
  297. kControlUseFaceMask                EQU        $0002
  298. kControlUseSizeMask                EQU        $0004
  299. kControlUseForeColorMask        EQU        $0008
  300. kControlUseBackColorMask        EQU        $0010
  301. kControlUseModeMask                EQU        $0020
  302. kControlUseJustMask                EQU        $0040
  303. kControlUseAllMask                EQU        $00FF
  304. kControlAddFontSizeMask            EQU        $0100
  305. ;  flags available in Appearance 1.1 or later 
  306. ;  AddToMetaFont indicates that we want to start with a standard system        
  307. ;  font, but then we'd like to add the other attributes. Normally, the meta    
  308. ;  font ignores all other flags                                             
  309.  
  310. kControlAddToMetaFontMask        EQU        $0200
  311. ControlFontStyleRec        RECORD 0
  312. flags                     ds.w    1                ; offset: $0 (0)
  313. font                     ds.w    1                ; offset: $2 (2)
  314. size                     ds.w    1                ; offset: $4 (4)
  315. style                     ds.w    1                ; offset: $6 (6)
  316. mode                     ds.w    1                ; offset: $8 (8)
  317. just                     ds.w    1                ; offset: $A (10)
  318. foreColor                 ds        RGBColor        ; offset: $C (12)
  319. backColor                 ds        RGBColor        ; offset: $12 (18)
  320. sizeof                     EQU *                    ; size:   $18 (24)
  321.                         ENDR
  322. ; typedef struct ControlFontStyleRec *    ControlFontStylePtr
  323.  
  324. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  325. ;     • Common data tags for Get/SetControlData                                                            
  326. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  327.  
  328. kControlFontStyleTag            EQU        'font'
  329. kControlKeyFilterTag            EQU        'fltr'
  330.  
  331. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  332. ;     • Control Feature Bits                                                                                
  333. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  334.  
  335.                                                             ; Control feature bits - returned by GetControlFeatures 
  336. kControlSupportsGhosting        EQU        $01
  337. kControlSupportsEmbedding        EQU        $02
  338. kControlSupportsFocus            EQU        $04
  339. kControlWantsIdle                EQU        $08
  340. kControlWantsActivate            EQU        $10
  341. kControlHandlesTracking            EQU        $20
  342. kControlSupportsDataAccess        EQU        $40
  343. kControlHasSpecialBackground    EQU        $80
  344. kControlGetsFocusOnClick        EQU        $0100
  345. kControlSupportsCalcBestRect    EQU        $0200
  346. kControlSupportsLiveFeedback    EQU        $0400
  347. ;  Features introduced in Appearance 1.0.1 
  348.  
  349. kControlHasRadioBehavior        EQU        $0800
  350. ;  Features introduced in Appearance 1.1 
  351.  
  352. kControlAutoToggles                EQU        $4000
  353. kControlSupportsGetRegion        EQU        $00020000
  354. ;  Control Messages 
  355.  
  356. kControlMsgDrawGhost            EQU        13
  357. kControlMsgCalcBestRect            EQU        14                    ; Calculate best fitting rectangle for control
  358. kControlMsgHandleTracking        EQU        15
  359. kControlMsgFocus                EQU        16                    ; param indicates action.
  360. kControlMsgKeyDown                EQU        17
  361. kControlMsgIdle                    EQU        18
  362. kControlMsgGetFeatures            EQU        19
  363. kControlMsgSetData                EQU        20
  364. kControlMsgGetData                EQU        21
  365. kControlMsgActivate                EQU        22
  366. kControlMsgSetUpBackground        EQU        23
  367. kControlMsgCalcValueFromPos        EQU        26
  368. kControlMsgTestNewMsgSupport    EQU        27                    ; See if this control supports new messaging
  369. ;  Messages in Appearance 1.0.1 or later
  370.  
  371. kControlMsgSubValueChanged        EQU        25
  372. kControlMsgSubControlAdded        EQU        28
  373. kControlMsgSubControlRemoved    EQU        29
  374. ;  Messages in Appearance 1.1 or later 
  375.  
  376. kControlMsgApplyTextColor        EQU        30
  377. kControlMsgGetRegion            EQU        31
  378. ; ——————————————————————————————————————————————————————————————————————————————————————
  379. ;      This structure is passed into a CDEF when called with the kControlMsgHandleTracking    
  380. ;     message                                                                             
  381. ; ——————————————————————————————————————————————————————————————————————————————————————
  382. ControlTrackingRec        RECORD 0
  383. startPt                     ds        Point            ; offset: $0 (0)
  384. modifiers                 ds.w    1                ; offset: $4 (4)
  385. action                     ds.l    1                ; offset: $6 (6)
  386. sizeof                     EQU *                    ; size:   $A (10)
  387.                         ENDR
  388. ; typedef struct ControlTrackingRec *    ControlTrackingPtr
  389.  
  390. ; ——————————————————————————————————————————————————————————————————————————————————————
  391. ;  This structure is passed into a CDEF when called with the kControlMsgKeyDown message 
  392. ; ——————————————————————————————————————————————————————————————————————————————————————
  393. ControlKeyDownRec        RECORD 0
  394. modifiers                 ds.w    1                ; offset: $0 (0)
  395. keyCode                     ds.w    1                ; offset: $2 (2)
  396. charCode                 ds.w    1                ; offset: $4 (4)
  397. sizeof                     EQU *                    ; size:   $6 (6)
  398.                         ENDR
  399. ; typedef struct ControlKeyDownRec *    ControlKeyDownPtr
  400.  
  401. ; ——————————————————————————————————————————————————————————————————————————————————————
  402. ;  This structure is passed into a CDEF when called with the kControlMsgGetData or        
  403. ;  kControlMsgSetData message                                                             
  404. ; ——————————————————————————————————————————————————————————————————————————————————————
  405. ControlDataAccessRec    RECORD 0
  406. tag                         ds.l    1                ; offset: $0 (0)
  407. part                     ds.l    1                ; offset: $4 (4)
  408. size                     ds.l    1                ; offset: $8 (8)
  409. dataPtr                     ds.l    1                ; offset: $C (12)
  410. sizeof                     EQU *                    ; size:   $10 (16)
  411.                         ENDR
  412. ; typedef struct ControlDataAccessRec *    ControlDataAccessPtr
  413.  
  414. ; ——————————————————————————————————————————————————————————————————————————————————————
  415. ;  This structure is passed into a CDEF when called with the kControlCalcBestRect msg     
  416. ; ——————————————————————————————————————————————————————————————————————————————————————
  417. ControlCalcSizeRec        RECORD 0
  418. height                     ds.w    1                ; offset: $0 (0)
  419. width                     ds.w    1                ; offset: $2 (2)
  420. baseLine                 ds.w    1                ; offset: $4 (4)
  421. sizeof                     EQU *                    ; size:   $6 (6)
  422.                         ENDR
  423. ; typedef struct ControlCalcSizeRec *    ControlCalcSizePtr
  424.  
  425. ; ——————————————————————————————————————————————————————————————————————————————————————
  426. ;  This structure is passed into a CDEF when called with the kControlMsgSetUpBackground 
  427. ;  message is sent                                                                        
  428. ; ——————————————————————————————————————————————————————————————————————————————————————
  429. ControlBackgroundRec    RECORD 0
  430. depth                     ds.w    1                ; offset: $0 (0)
  431. colorDevice                 ds.b    1                ; offset: $2 (2)
  432.                          ORG 4
  433. sizeof                     EQU *                    ; size:   $4 (4)
  434.                         ENDR
  435. ; typedef struct ControlBackgroundRec *    ControlBackgroundPtr
  436.  
  437. ; ——————————————————————————————————————————————————————————————————————————————————————
  438. ;  This structure is passed into a CDEF when called with the kControlMsgApplyTextColor    
  439. ;  message is sent                                                                        
  440. ; ——————————————————————————————————————————————————————————————————————————————————————
  441. ControlApplyTextColorRec RECORD 0
  442. depth                     ds.w    1                ; offset: $0 (0)
  443. colorDevice                 ds.b    1                ; offset: $2 (2)
  444. active                     ds.b    1                ; offset: $3 (3)
  445. sizeof                     EQU *                    ; size:   $4 (4)
  446.                         ENDR
  447. ; typedef struct ControlApplyTextColorRec * ControlApplyTextColorPtr
  448.  
  449. ; ——————————————————————————————————————————————————————————————————————————————————————
  450. ;  This structure is passed into a CDEF when called with the kControlMsgGetRegion        
  451. ;  message is sent                                                                        
  452. ; ——————————————————————————————————————————————————————————————————————————————————————
  453. ControlGetRegionRec        RECORD 0
  454. region                     ds.l    1                ; offset: $0 (0)
  455. part                     ds.w    1                ; offset: $4 (4)
  456. sizeof                     EQU *                    ; size:   $6 (6)
  457.                         ENDR
  458. ; typedef struct ControlGetRegionRec *    ControlGetRegionPtr
  459.  
  460. ; ——————————————————————————————————————————————————————————————————————————————————————
  461. ;     Key Filter                                                                            
  462. ;                                                                                         
  463. ;  Definition of a key filter for intercepting and possibly changing keystrokes            
  464. ;  which are destined for a control                                                        
  465. ; ——————————————————————————————————————————————————————————————————————————————————————
  466. ; ——————————————————————————————————————————————————————————————————————————————————————
  467. ;     • BEVEL BUTTON INTERFACE (CDEF 2)                                                    
  468. ; ——————————————————————————————————————————————————————————————————————————————————————
  469. ;     Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    
  470. ;  (pushbutton/toggle/sticky), and the bevel size. You also have the option of            
  471. ;     attaching a menu to it. When a menu is present, you can specify which way the         
  472. ;     popup arrow is facing (down or right).                                                
  473. ;                                                                                         
  474. ;     This is all made possible by overloading the Min, Max, and Value parameters for the    
  475. ;     control, as well as adjusting the variant. Here's the breakdown of what goes where:    
  476. ;                                                                                         
  477. ;     Parameter                    What Goes Here                                            
  478. ;     ———————————————————            ————————————————————————————————————————————————————    
  479. ;     Min                            Hi Byte = Behavior, Lo Byte = content type.                
  480. ;     Max                            ResID for resource-based content types.                    
  481. ;     Value                        MenuID to attach, 0 = no menu, please.                    
  482. ;                                                                                         
  483. ;     The variant is broken down into two halfs. The low 2 bits control the bevel type.    
  484. ;     Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    
  485. ;     whether or not to use the control's owning window's font.                            
  486. ;                                                                                         
  487. ;     Constants for all you need to put this together are below. The values for behaviors    
  488. ;     are set up so that you can simply add them to the content type and pass them into    
  489. ;     the Min parameter of NewControl.                                                    
  490. ;                                                                                         
  491. ;     An example call:                                                                    
  492. ;                                                                                         
  493. ;     control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         
  494. ;                             kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    
  495. ;                             0L );                                                        
  496. ;                                                                                         
  497. ;     Attaching a menu:                                                                    
  498. ;                                                                                         
  499. ;     control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    
  500. ;             myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    
  501. ;                                                                                         
  502. ;     This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.
  503. ;     This also puts the menu up to the right of the button. You can also specify that a    
  504. ;     menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        
  505. ;     into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    
  506. ;     helper function will return the last item chosen from the menu, whether or not it    
  507. ;     was checked.                                                                        
  508. ;                                                                                         
  509. ;     NOTE:     Bevel buttons with menus actually have *two* values. The value of the         
  510. ;             button (on/off), and the value of the menu. The menu value can be gotten    
  511. ;             with the GetBevelButtonMenuValue helper function.                            
  512. ;                                                                                         
  513. ;     Handle-based Content                                                                
  514. ;     ————————————————————                                                                
  515. ;     You can create your control and then set the content to an existing handle to an    
  516. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  517. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  518. ;     not try to dispose of handle-based content. If you are changing the content type of    
  519. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  520. ;     based content with a resource-based content to properly dispose of the handle,        
  521. ;     else a memory leak will ensue.                                                        
  522. ;                                                                                         
  523.  
  524.                                                             ; Bevel Button Proc IDs 
  525. kControlBevelButtonSmallBevelProc EQU    32
  526. kControlBevelButtonNormalBevelProc EQU    33
  527. kControlBevelButtonLargeBevelProc EQU    34
  528.  
  529.                                                             ; Bevel button graphic alignment values 
  530. kControlBevelButtonAlignSysDirection EQU -1                    ; only left or right
  531. kControlBevelButtonAlignCenter    EQU        0
  532. kControlBevelButtonAlignLeft    EQU        1
  533. kControlBevelButtonAlignRight    EQU        2
  534. kControlBevelButtonAlignTop        EQU        3
  535. kControlBevelButtonAlignBottom    EQU        4
  536. kControlBevelButtonAlignTopLeft    EQU        5
  537. kControlBevelButtonAlignBottomLeft EQU    6
  538. kControlBevelButtonAlignTopRight EQU    7
  539. kControlBevelButtonAlignBottomRight EQU    8
  540. ; typedef SInt16                         ControlButtonGraphicAlignment
  541.  
  542.  
  543.                                                             ; Bevel button text alignment values 
  544. kControlBevelButtonAlignTextSysDirection EQU 0
  545. kControlBevelButtonAlignTextCenter EQU    1
  546. kControlBevelButtonAlignTextFlushRight EQU -1
  547. kControlBevelButtonAlignTextFlushLeft EQU -2
  548. ; typedef SInt16                         ControlButtonTextAlignment
  549.  
  550.  
  551.                                                             ; Bevel button text placement values 
  552. kControlBevelButtonPlaceSysDirection EQU -1                    ; if graphic on right, then on left
  553. kControlBevelButtonPlaceNormally EQU    0
  554. kControlBevelButtonPlaceToRightOfGraphic EQU 1
  555. kControlBevelButtonPlaceToLeftOfGraphic EQU 2
  556. kControlBevelButtonPlaceBelowGraphic EQU 3
  557. kControlBevelButtonPlaceAboveGraphic EQU 4
  558. ; typedef SInt16                         ControlButtonTextPlacement
  559.  
  560. ;  Add these variant codes to kBevelButtonSmallBevelProc to change the type of button 
  561.  
  562. kControlBevelButtonSmallBevelVariant EQU 0
  563. kControlBevelButtonNormalBevelVariant EQU $01
  564. kControlBevelButtonLargeBevelVariant EQU $02
  565. kControlBevelButtonMenuOnRight    EQU        $04
  566.  
  567. ;   Behaviors of bevel buttons. These are set up so you can add
  568. ;   them together with the content types.
  569.  
  570.  
  571.  
  572. kControlBehaviorPushbutton        EQU        0
  573. kControlBehaviorToggles            EQU        $0100
  574. kControlBehaviorSticky            EQU        $0200
  575. kControlBehaviorMultiValueMenu    EQU        $4000                ; only makes sense when a menu is attached.
  576. kControlBehaviorOffsetContents    EQU        $8000
  577. ;  Behaviors for 1.0.1 or later 
  578.  
  579. kControlBehaviorCommandMenu        EQU        $2000                ; menu holds commands, not choices. Overrides multi-value bit.
  580. ;  Content types supported by bevel buttons *and* image wells
  581.  
  582. kControlContentTextOnly            EQU        0
  583. kControlContentIconSuiteRes        EQU        1
  584. kControlContentCIconRes            EQU        2
  585. kControlContentPictRes            EQU        3
  586. kControlContentIconSuiteHandle    EQU        129
  587. kControlContentCIconHandle        EQU        130
  588. kControlContentPictHandle        EQU        131
  589. kControlContentIconRef            EQU        132
  590. ; typedef SInt16                         ControlContentType
  591.  
  592. ;  Data tags supported by the bevel button controls 
  593.  
  594. kControlBevelButtonContentTag    EQU        'cont'                ; ButtonContentInfo
  595. kControlBevelButtonTransformTag    EQU        'tran'                ; IconTransformType
  596. kControlBevelButtonTextAlignTag    EQU        'tali'                ; ButtonTextAlignment
  597. kControlBevelButtonTextOffsetTag EQU    'toff'                ; SInt16
  598. kControlBevelButtonGraphicAlignTag EQU    'gali'                ; ButtonGraphicAlignment
  599. kControlBevelButtonGraphicOffsetTag EQU    'goff'                ; Point
  600. kControlBevelButtonTextPlaceTag    EQU        'tplc'                ; ButtonTextPlacement
  601. kControlBevelButtonMenuValueTag    EQU        'mval'                ; SInt16
  602. kControlBevelButtonMenuHandleTag EQU    'mhnd'                ; MenuHandle
  603. kControlBevelButtonCenterPopupGlyphTag EQU 'pglc'            ; Boolean: true = center, false = bottom right
  604. ;  These are tags in 1.0.1 or later 
  605.  
  606. kControlBevelButtonLastMenuTag    EQU        'lmnu'                ; SInt16: menuID of last menu item selected from
  607. kControlBevelButtonMenuDelayTag    EQU        'mdly'                ; SInt32: ticks to delay before menu appears
  608. ;  tags available with Appearance 1.1 or later 
  609.  
  610.                                                             ; Boolean: True = if an icon of the ideal size for
  611.                                                             ; the button isn't available, scale a larger or
  612.                                                             ; smaller icon to the ideal size. False = don't
  613.                                                             ; scale; draw a smaller icon or clip a larger icon.
  614.                                                             ; Default is false. Only applies to IconSuites and
  615. kControlBevelButtonScaleIconTag    EQU        'scal'                ; IconRefs.
  616. ;  Structure to pass into bevel buttons and image wells to set/get content type 
  617. ControlButtonContentInfo RECORD 0
  618. contentType                 ds.w    1                ; offset: $0 (0)
  619. resID                     ds.w    1                ; offset: $2 (2)
  620.                          ORG 2
  621. cIconHandle                 ds.l    1                ; offset: $2 (2)
  622.                          ORG 2
  623. iconSuite                 ds.l    1                ; offset: $2 (2)
  624.                          ORG 2
  625. iconRef                     ds.l    1                ; offset: $2 (2)
  626.                          ORG 2
  627. picture                     ds.l    1                ; offset: $2 (2)
  628. sizeof                     EQU *                    ; size:   $6 (6)
  629.                         ENDR
  630. ; typedef struct ControlButtonContentInfo * ControlButtonContentInfoPtr
  631.  
  632. ; ——————————————————————————————————————————————————————————————————————————————————————
  633. ;     • SLIDER (CDEF 3)                                                                    
  634. ; ——————————————————————————————————————————————————————————————————————————————————————
  635. ;     There are several variants that control the behavior of the slider control. Any        
  636. ;     combination of the following three constants can be added to the basic CDEF ID        
  637. ;     (kSliderProc).                                                                        
  638. ;                                                                                         
  639. ;     Variants:                                                                            
  640. ;                                                                                         
  641. ;         kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    
  642. ;                                 ActionProc is called (set via SetControlAction) as the    
  643. ;                                 indicator is dragged. The value is updated so that the    
  644. ;                                 actionproc can adjust some other property based on the    
  645. ;                                 value each time the action proc is called. If no action    
  646. ;                                 proc is installed, it reverts to the ghost indicator.    
  647. ;                                                                                         
  648. ;         kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            
  649. ;                                 rectangle must be large enough to accomidate the tick    
  650. ;                                 marks.                                                    
  651. ;                                                                                         
  652. ;         kSliderReverseDirection    Slider thumb points in opposite direction than normal.    
  653. ;                                 If the slider is vertical, the thumb will point to the    
  654. ;                                 left, if the slider is horizontal, the thumb will point    
  655. ;                                 upwards.                                                
  656. ;                                                                                         
  657. ;         kSliderNonDirectional    This option overrides the kSliderReverseDirection and    
  658. ;                                 kSliderHasTickMarks variants. It creates an indicator    
  659. ;                                 which is rectangular and doesn't point in any direction    
  660. ;                                 like the normal indicator does.                            
  661.  
  662.                                                             ; Slider proc IDs 
  663. kControlSliderProc                EQU        48
  664. kControlSliderLiveFeedback        EQU        $01
  665. kControlSliderHasTickMarks        EQU        $02
  666. kControlSliderReverseDirection    EQU        $04
  667. kControlSliderNonDirectional    EQU        $08
  668.  
  669. ; ——————————————————————————————————————————————————————————————————————————————————————
  670. ;     • DISCLOSURE TRIANGLE (CDEF 4)                                                        
  671. ; ——————————————————————————————————————————————————————————————————————————————————————
  672. ;     This control can be used as either left or right facing. It can also handle its own    
  673. ;     tracking if you wish. This means that when the 'autotoggle' variant is used, if the    
  674. ;     user clicks the control, it's state will change automatically from open to closed    
  675. ;     and vice-versa depending on its initial state. After a successful call to Track-    
  676. ;      Control, you can just check the current value to see what state it was switched to.    
  677.  
  678.                                                             ; Triangle proc IDs 
  679. kControlTriangleProc            EQU        64
  680. kControlTriangleLeftFacingProc    EQU        65
  681. kControlTriangleAutoToggleProc    EQU        66
  682. kControlTriangleLeftFacingAutoToggleProc EQU 67
  683.  
  684.                                                             ; Tagged data supported by disclosure triangles 
  685. kControlTriangleLastValueTag    EQU        'last'                ; SInt16
  686. ; ——————————————————————————————————————————————————————————————————————————————————————
  687. ;     • PROGRESS INDICATOR (CDEF 5)                                                        
  688. ; ——————————————————————————————————————————————————————————————————————————————————————
  689. ;     This CDEF implements both determinate and indeterminate progress bars. To switch,     
  690. ;     just use SetControlData to set the indeterminate flag to make it indeterminate call    
  691. ;     IdleControls to step thru the animation. IdleControls should be called at least        
  692. ;     once during your event loop.                                                        
  693. ;                                                                                         
  694.  
  695.                                                             ; Progress Bar proc IDs 
  696. kControlProgressBarProc            EQU        80
  697.  
  698.                                                             ; Tagged data supported by progress bars 
  699. kControlProgressBarIndeterminateTag EQU    'inde'                ; Boolean
  700. ; ——————————————————————————————————————————————————————————————————————————————————————
  701. ;     • LITTLE ARROWS (CDEF 6)                                                            
  702. ; ——————————————————————————————————————————————————————————————————————————————————————
  703. ;      This control implements the little up and down arrows you'd see in the Memory        
  704. ;     control panel for adjusting the cache size.                                         
  705.  
  706.                                                             ; Little Arrows proc IDs 
  707. kControlLittleArrowsProc        EQU        96
  708. ; ——————————————————————————————————————————————————————————————————————————————————————
  709. ;     • CHASING ARROWS (CDEF 7)                                                            
  710. ; ——————————————————————————————————————————————————————————————————————————————————————
  711. ;     To animate this control, make sure to call IdleControls repeatedly.                    
  712. ;                                                                                         
  713.  
  714.                                                             ; Chasing Arrows proc IDs 
  715. kControlChasingArrowsProc        EQU        112
  716. ; ——————————————————————————————————————————————————————————————————————————————————————
  717. ;     • TABS (CDEF 8)                                                                        
  718. ; ——————————————————————————————————————————————————————————————————————————————————————
  719. ;     Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    
  720. ;     and an icon suite ID for each tab.                                                    
  721. ;                                                                                         
  722. ;     The ID of the tab# resource that you wish to associate with a tab control should     
  723. ;     be passed in as the Value parameter of the control. If you are using GetNewControl, 
  724. ;     then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    
  725. ;     on creation.                                                                        
  726. ;                                                                                         
  727. ;     Passing zero in for the tab# resource tells the control not to read in a tab# res.    
  728. ;     You can then use SetControlMaximum to add tabs, followed by a call to SetControlData
  729. ;     with the kControlTabInfoTag, passing in a pointer to a ControlTabInfoRec. This sets    
  730. ;      the name and optionally an icon for a tab.                                            
  731.  
  732.                                                             ; Tabs proc IDs 
  733. kControlTabLargeProc            EQU        128                    ; Large tab size, north facing    
  734. kControlTabSmallProc            EQU        129                    ; Small tab size, north facing    
  735. kControlTabLargeNorthProc        EQU        128                    ; Large tab size, north facing    
  736. kControlTabSmallNorthProc        EQU        129                    ; Small tab size, north facing    
  737. kControlTabLargeSouthProc        EQU        130                    ; Large tab size, south facing    
  738. kControlTabSmallSouthProc        EQU        131                    ; Small tab size, south facing    
  739. kControlTabLargeEastProc        EQU        132                    ; Large tab size, east facing    
  740. kControlTabSmallEastProc        EQU        133                    ; Small tab size, east facing    
  741. kControlTabLargeWestProc        EQU        134                    ; Large tab size, west facing    
  742. kControlTabSmallWestProc        EQU        135                    ; Small tab size, west facing    
  743.  
  744.                                                             ; Tagged data supported by progress bars 
  745. kControlTabContentRectTag        EQU        'rect'                ; Rect
  746. kControlTabEnabledFlagTag        EQU        'enab'                ; Boolean
  747. kControlTabFontStyleTag            EQU        'font'                ; ControlFontStyleRec
  748. ;  New tags in 1.0.1 or later 
  749.  
  750. kControlTabInfoTag                EQU        'tabi'                ; ControlTabInfoRec
  751.  
  752. kControlTabInfoVersionZero        EQU        0
  753. ControlTabInfoRec        RECORD 0
  754. version                     ds.w    1                ; offset: $0 (0)        ;  version of this structure.
  755. iconSuiteID                 ds.w    1                ; offset: $2 (2)        ;  icon suite to use. Zero indicates no icon
  756. name                     ds        Str255            ; offset: $4 (4)        ;  name to be displayed on the tab
  757. sizeof                     EQU *                    ; size:   $104 (260)
  758.                         ENDR
  759. ; ——————————————————————————————————————————————————————————————————————————————————————
  760. ;     • VISUAL SEPARATOR (CDEF 9)                                                            
  761. ; ——————————————————————————————————————————————————————————————————————————————————————
  762. ;     Separator lines determine their orientation (horizontal or vertical) automatically    
  763. ;     based on the relative height and width of their contrlRect.                            
  764.  
  765.                                                             ; Visual separator proc IDs 
  766. kControlSeparatorLineProc        EQU        144
  767.  
  768. ; ——————————————————————————————————————————————————————————————————————————————————————
  769. ;     • GROUP BOX (CDEF 10)                                                                
  770. ; ——————————————————————————————————————————————————————————————————————————————————————
  771. ;     The group box CDEF can be use in several ways. It can have no title, a text title,     
  772. ;     a check box as the title, or a popup button as a title. There are two versions of     
  773. ;     group boxes, primary and secondary, which look slightly different.                    
  774.  
  775.                                                             ; Group Box proc IDs 
  776. kControlGroupBoxTextTitleProc    EQU        160
  777. kControlGroupBoxCheckBoxProc    EQU        161
  778. kControlGroupBoxPopupButtonProc    EQU        162
  779. kControlGroupBoxSecondaryTextTitleProc EQU 164
  780. kControlGroupBoxSecondaryCheckBoxProc EQU 165
  781. kControlGroupBoxSecondaryPopupButtonProc EQU 166
  782.  
  783.                                                             ; Tagged data supported by group box 
  784. kControlGroupBoxMenuHandleTag    EQU        'mhan'                ; MenuHandle (popup title only)
  785. kControlGroupBoxFontStyleTag    EQU        'font'                ; ControlFontStyleRec
  786. ;  tags available with Appearance 1.1 or later 
  787.  
  788. kControlGroupBoxTitleRectTag    EQU        'trec'                ; Rect. Rectangle that the title text/control is drawn in. (get only)
  789. ; ——————————————————————————————————————————————————————————————————————————————————————
  790. ;     • IMAGE WELL (CDEF 11)                                                                
  791. ; ——————————————————————————————————————————————————————————————————————————————————————
  792. ;     Image Wells allow you to control the content type (pict/icon/etc.) shown in the     
  793. ;     well.                                                                                
  794. ;                                                                                         
  795. ;     This is made possible by overloading the Min and Value parameters for the control.    
  796. ;                                                                                         
  797. ;     Parameter                    What Goes Here                                            
  798. ;     ———————————————————            ——————————————————————————————————————————————————        
  799. ;     Min                            content type (see constants for bevel buttons)            
  800. ;     Value                        Resource ID of content type, if resource-based.            
  801. ;                                                                                         
  802. ;                                                                                         
  803. ;     Handle-based Content                                                                
  804. ;     ————————————————————                                                                
  805. ;     You can create your control and then set the content to an existing handle to an    
  806. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  807. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  808. ;     not try to dispose of handle-based content. If you are changing the content type of    
  809. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  810. ;     based content with a resource-based content to properly dispose of the handle,        
  811. ;     else a memory leak will ensue.                                                        
  812. ;                                                                                         
  813.  
  814.                                                             ; Image Well proc IDs 
  815. kControlImageWellProc            EQU        176
  816.  
  817.                                                             ; Tagged data supported by image wells 
  818. kControlImageWellContentTag        EQU        'cont'                ; ButtonContentInfo
  819. kControlImageWellTransformTag    EQU        'tran'                ; IconTransformType
  820. ; ——————————————————————————————————————————————————————————————————————————————————————
  821. ;     • POPUP ARROW (CDEF 12)                                                                
  822. ; ——————————————————————————————————————————————————————————————————————————————————————
  823. ;     The popup arrow CDEF is used to draw the small arrow normally associated with a     
  824. ;     popup control. The arrow can point in four directions, and a small or large version 
  825. ;     can be used. This control is provided to allow clients to draw the arrow in a         
  826. ;     normalized fashion which will take advantage of themes automatically.                
  827. ;                                                                                         
  828.  
  829.                                                             ; Popup Arrow proc IDs 
  830. kControlPopupArrowEastProc        EQU        192
  831. kControlPopupArrowWestProc        EQU        193
  832. kControlPopupArrowNorthProc        EQU        194
  833. kControlPopupArrowSouthProc        EQU        195
  834. kControlPopupArrowSmallEastProc    EQU        196
  835. kControlPopupArrowSmallWestProc    EQU        197
  836. kControlPopupArrowSmallNorthProc EQU    198
  837. kControlPopupArrowSmallSouthProc EQU    199
  838. ; ——————————————————————————————————————————————————————————————————————————————————————
  839. ;     • PLACARD (CDEF 14)                                                                    
  840. ; ——————————————————————————————————————————————————————————————————————————————————————
  841.  
  842.                                                             ; Placard proc IDs 
  843. kControlPlacardProc                EQU        224
  844. ; ——————————————————————————————————————————————————————————————————————————————————————
  845. ;     • CLOCK (CDEF 15)                                                                    
  846. ; ——————————————————————————————————————————————————————————————————————————————————————
  847. ;      NOTE:    You can specify more options in the Value paramter when creating the clock.    
  848. ;             See below.                                                                    
  849. ;                                                                                         
  850. ;     NOTE:    Under Appearance 1.1, the clock control knows and returns more part codes.    
  851. ;             The new clock-specific part codes are defined with the other control parts.    
  852. ;             Besides these clock-specific parts, we also return kControlUpButtonPart        
  853. ;             and kControlDownButtonPart when they hit the up and down arrows.            
  854. ;             The new part codes give you more flexibility for focusing and hit testing.    
  855. ;                                                                                         
  856. ;             The original kControlClockPart is still valid. When hit testing, it means    
  857. ;             that some non-editable area of the clock's whitespace has been clicked.        
  858. ;             When focusing a currently unfocused clock, it changes the focus to the        
  859. ;             first part; it is the same as passing kControlFocusNextPart. When            
  860. ;             re-focusing a focused clock, it will not change the focus at all.            
  861.  
  862.                                                             ; Clock proc IDs 
  863. kControlClockTimeProc            EQU        240
  864. kControlClockTimeSecondsProc    EQU        241
  865. kControlClockDateProc            EQU        242
  866. kControlClockMonthYearProc        EQU        243
  867. ; ——————————————————————————————————————————————————————————————————————————————————————
  868. ;      These flags can be passed into 'value' field on creation of the control.            
  869. ;      Value is set to 0 after control is created.                                            
  870. ;                                                                                         
  871. ;     The kClockIsLive value tells the clock to automatically update on idle (clock will    
  872. ;     have the current time). This flag is only valid when the kClockIsDisplayOnly flag    
  873. ;     is set.                                                                                
  874. ; ——————————————————————————————————————————————————————————————————————————————————————
  875.  
  876. kControlClockNoFlags            EQU        0
  877. kControlClockIsDisplayOnly        EQU        1
  878. kControlClockIsLive                EQU        2
  879.  
  880.                                                             ; Tagged data supported by clocks 
  881. kControlClockLongDateTag        EQU        'date'                ; LongDateRec
  882. kControlClockFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  883. ; ——————————————————————————————————————————————————————————————————————————————————————
  884. ;     • USER PANE (CDEF 16)                                                                
  885. ; ——————————————————————————————————————————————————————————————————————————————————————
  886.  
  887.                                                             ; User Pane proc IDs 
  888. kControlUserPaneProc            EQU        256
  889. ;  Tagged data supported by user panes 
  890. ;  Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. 
  891.  
  892. kControlUserItemDrawProcTag        EQU        'uidp'                ; UserItemUPP
  893. kControlUserPaneDrawProcTag        EQU        'draw'                ; ControlUserPaneDrawingUPP
  894. kControlUserPaneHitTestProcTag    EQU        'hitt'                ; ControlUserPaneHitTestUPP
  895. kControlUserPaneTrackingProcTag    EQU        'trak'                ; ControlUserPaneTrackingUPP
  896. kControlUserPaneIdleProcTag        EQU        'idle'                ; ControlUserPaneIdleUPP
  897. kControlUserPaneKeyDownProcTag    EQU        'keyd'                ; ControlUserPaneKeyDownUPP
  898. kControlUserPaneActivateProcTag    EQU        'acti'                ; ControlUserPaneActivateUPP
  899. kControlUserPaneFocusProcTag    EQU        'foci'                ; ControlUserPaneFocusUPP
  900. kControlUserPaneBackgroundProcTag EQU    'back'                ; ControlUserPaneBackgroundUPP
  901.  
  902. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  903. ;      • EDIT TEXT (CDEF 17)
  904. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  905.  
  906.  
  907.  
  908.                                                             ; Edit Text proc IDs 
  909. kControlEditTextProc            EQU        272
  910. kControlEditTextPasswordProc    EQU        274
  911. ;  proc IDs available with Appearance 1.1 or later 
  912.  
  913. kControlEditTextInlineInputProc    EQU        276                    ; Can't combine with the other variants
  914.  
  915.                                                             ; Tagged data supported by edit text 
  916. kControlEditTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  917. kControlEditTextTextTag            EQU        'text'                ; Buffer of chars - you supply the buffer
  918. kControlEditTextTEHandleTag        EQU        'than'                ; The TEHandle of the text edit record
  919. kControlEditTextKeyFilterTag    EQU        'fltr'
  920. kControlEditTextSelectionTag    EQU        'sele'                ; EditTextSelectionRec
  921. kControlEditTextPasswordTag        EQU        'pass'                ; The clear text password text
  922. ;  tags available with Appearance 1.1 or later 
  923.  
  924. kControlEditTextKeyScriptBehaviorTag EQU 'kscr'                ; ControlKeyScriptBehavior. Defaults to "PrefersRoman" for password fields,
  925.                                                             ;        or "AllowAnyScript" for non-password fields.
  926. kControlEditTextLockedTag        EQU        'lock'                ; Boolean. Locking disables editability.
  927. kControlEditTextFixedTextTag    EQU        'ftxt'                ; Like the normal text tag, but fixes inline input first
  928. kControlEditTextValidationProcTag EQU    'vali'                ; ControlEditTextValidationUPP. Called when a key filter can't be: after cut, paste, etc.
  929. kControlEditTextInlinePreUpdateProcTag EQU 'prup'            ; TSMTEPreUpdateUPP and TSMTEPostUpdateUpp. For use with inline input variant...
  930. kControlEditTextInlinePostUpdateProcTag EQU 'poup'            ; ...The refCon parameter will contain the ControlHandle.
  931. ControlEditTextSelectionRec RECORD 0
  932. ;  Structure for getting the edit text selection 
  933. selStart                 ds.w    1                ; offset: $0 (0)
  934. selEnd                     ds.w    1                ; offset: $2 (2)
  935. sizeof                     EQU *                    ; size:   $4 (4)
  936.                         ENDR
  937. ; typedef struct ControlEditTextSelectionRec * ControlEditTextSelectionPtr
  938.  
  939. ; ——————————————————————————————————————————————————————————————————————————————————————
  940. ;     • STATIC TEXT (CDEF 18)                                                                
  941. ; ——————————————————————————————————————————————————————————————————————————————————————
  942. ;  Static Text proc IDs 
  943.  
  944. kControlStaticTextProc            EQU        288
  945. ;  Tagged data supported by static text 
  946.  
  947. kControlStaticTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  948. kControlStaticTextTextTag        EQU        'text'                ; Copy of text
  949. kControlStaticTextTextHeightTag    EQU        'thei'                ; SInt16
  950. ;  Tags available with appearance 1.1 or later 
  951.  
  952. kControlStaticTextTruncTag        EQU        'trun'                ; TruncCode (-1 means no truncation)
  953. ; ——————————————————————————————————————————————————————————————————————————————————————
  954. ;     • PICTURE CONTROL (CDEF 19)                                                            
  955. ; ——————————————————————————————————————————————————————————————————————————————————————
  956. ;     Value parameter should contain the ID of the picture you wish to display when        
  957. ;     creating controls of this type. If you don't want the control tracked at all, use     
  958. ;     the 'no track' variant.                                                                
  959.  
  960.                                                             ; Picture control proc IDs 
  961. kControlPictureProc                EQU        304
  962. kControlPictureNoTrackProc        EQU        305                    ; immediately returns kControlPicturePart
  963. ; ——————————————————————————————————————————————————————————————————————————————————————
  964. ;     • ICON CONTROL (CDEF 20)                                                            
  965. ; ——————————————————————————————————————————————————————————————————————————————————————
  966. ;     Value parameter should contain the ID of the ICON or cicn you wish to display when    
  967. ;     creating controls of this type. If you don't want the control tracked at all, use     
  968. ;     the 'no track' variant.                                                                
  969. ;  Icon control proc IDs 
  970.  
  971. kControlIconProc                EQU        320
  972. kControlIconNoTrackProc            EQU        321                    ; immediately returns kControlIconPart
  973. kControlIconSuiteProc            EQU        322
  974. kControlIconSuiteNoTrackProc    EQU        323                    ; immediately returns kControlIconPart
  975.  
  976.                                                             ; icon ref controls may have either an icon, color icon, icon suite, or icon ref.
  977.                                                             ; for data other than icon, you must set the data by passing a
  978.                                                             ; ControlButtonContentInfo to SetControlData
  979. kControlIconRefProc                EQU        324
  980. kControlIconRefNoTrackProc        EQU        325                    ; immediately returns kControlIconPart
  981. ;  Tagged data supported by icon controls 
  982.  
  983. kControlIconTransformTag        EQU        'trfm'                ; IconTransformType
  984. kControlIconAlignmentTag        EQU        'algn'                ; IconAlignmentType
  985. ;  Tags available with appearance 1.1 or later 
  986.  
  987. kControlIconResourceIDTag        EQU        'ires'                ; SInt16 resource ID of icon to use
  988. kControlIconContentTag            EQU        'cont'                ; accepts a ControlButtonContentInfo
  989. ; ——————————————————————————————————————————————————————————————————————————————————————
  990. ;     • WINDOW HEADER (CDEF 21)                                                            
  991. ; ——————————————————————————————————————————————————————————————————————————————————————
  992.  
  993.                                                             ; Window Header proc IDs 
  994. kControlWindowHeaderProc        EQU        336                    ; normal header
  995. kControlWindowListViewHeaderProc EQU    337                    ; variant for list views - no bottom line
  996. ; ——————————————————————————————————————————————————————————————————————————————————————
  997. ;     • LIST BOX (CDEF 22)                                                                
  998. ; ——————————————————————————————————————————————————————————————————————————————————————
  999. ;     Lists use an auxiliary resource to define their format. The resource type used is     
  1000. ;     'ldes' and a definition for it can be found in Appearance.r. The resource ID for     
  1001. ;     the ldes is passed in the 'value' parameter when creating the control. You may pass 
  1002. ;     zero in value. This tells the List Box control to not use a resource. The list will 
  1003. ;     be created with default values, and will use the standard LDEF (0). You can change    
  1004. ;     the list by getting the list handle. You can set the LDEF to use by using the tag    
  1005. ;     below (kControlListBoxLDEFTag)                                                        
  1006.  
  1007.                                                             ; List Box proc IDs 
  1008. kControlListBoxProc                EQU        352
  1009. kControlListBoxAutoSizeProc        EQU        353
  1010.  
  1011.                                                             ; Tagged data supported by list box 
  1012. kControlListBoxListHandleTag    EQU        'lhan'                ; ListHandle
  1013. kControlListBoxKeyFilterTag        EQU        'fltr'                ; ControlKeyFilterUPP
  1014. kControlListBoxFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  1015. ;  New tags in 1.0.1 or later 
  1016.  
  1017. kControlListBoxDoubleClickTag    EQU        'dblc'                ; Boolean. Was last click a double-click?
  1018. kControlListBoxLDEFTag            EQU        'ldef'                ; SInt16. ID of LDEF to use.
  1019. ; ——————————————————————————————————————————————————————————————————————————————————————
  1020. ;     • PUSH BUTTON (CDEF 23)                                                                
  1021. ; ——————————————————————————————————————————————————————————————————————————————————————
  1022. ;     The new standard checkbox and radio button controls support a "mixed" value that    
  1023. ;     indicates that the current setting contains a mixed set of on and off values. The     
  1024. ;     control value used to display this indication is defined in Controls.h:                
  1025. ;                                                                                         
  1026. ;         kControlCheckBoxMixedValue = 2                                                    
  1027. ;                                                                                         
  1028. ;     Two new variants of the standard pushbutton have been added to the standard control    
  1029. ;     suite that draw a color icon next to the control title. One variant draws the icon    
  1030. ;     on the left side, the other draws it on the right side (when the system justifica-    
  1031. ;     tion is right to left, these are reversed).                                            
  1032. ;                                                                                         
  1033. ;     When either of the icon pushbuttons are created, the contrlMax field of the control 
  1034. ;     record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    
  1035. ;                                                                                         
  1036. ;     In addition, a push button can now be told to draw with a default outline using the    
  1037. ;     SetControlData routine with the kPushButtonDefaultTag below.                        
  1038. ;                                                                                         
  1039. ;     A push button may also be marked using the kControlPushButtonCancelTag. This has    
  1040. ;     no visible representation, but does cause the button to play the CancelButton theme    
  1041. ;     sound instead of the regular pushbutton theme sound when pressed.                    
  1042. ;                                                                                         
  1043.  
  1044.                                                             ; Theme Push Button/Check Box/Radio Button proc IDs 
  1045. kControlPushButtonProc            EQU        368
  1046. kControlCheckBoxProc            EQU        369
  1047. kControlRadioButtonProc            EQU        370
  1048. kControlPushButLeftIconProc        EQU        374                    ; Standard pushbutton with left-side icon
  1049. kControlPushButRightIconProc    EQU        375                    ; Standard pushbutton with right-side icon
  1050. ;  Variants with Appearance 1.1 or later 
  1051.  
  1052. kControlCheckBoxAutoToggleProc    EQU        371
  1053. kControlRadioButtonAutoToggleProc EQU    372
  1054.  
  1055.                                                             ; Tagged data supported by standard buttons 
  1056. kControlPushButtonDefaultTag    EQU        'dflt'                ; default ring flag
  1057.  
  1058. kControlPushButtonCancelTag        EQU        'cncl'                ; cancel button flag (1.1 and later)
  1059. ; ——————————————————————————————————————————————————————————————————————————————————————
  1060. ;     • SCROLL BAR (CDEF 24)                                                                
  1061. ; ——————————————————————————————————————————————————————————————————————————————————————
  1062. ;     This is the new Appearance scroll bar.                                                
  1063. ;                                                                                         
  1064.  
  1065.                                                             ; Theme Scroll Bar proc IDs 
  1066. kControlScrollBarProc            EQU        384                    ; normal scroll bar
  1067. kControlScrollBarLiveProc        EQU        386                    ; live scrolling variant
  1068. ; ——————————————————————————————————————————————————————————————————————————————————————
  1069. ;     • POPUP BUTTON (CDEF 25)                                                            
  1070. ; ——————————————————————————————————————————————————————————————————————————————————————
  1071. ;     This is the new Appearance Popup Button. It takes the same variants and does the     
  1072. ;     same overloading as the previous popup menu control. There are some differences:    
  1073. ;                                                                                         
  1074. ;     Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    
  1075. ;     resource. Instead, you can build the menu and later stuff the menuhandle field in     
  1076. ;     the popup data information.                                                            
  1077. ;                                                                                         
  1078. ;     You can pass -1 in the Max parameter to have the control calculate the width of the    
  1079. ;     title on its own instead of guessing and then tweaking to get it right. It adds the    
  1080. ;     appropriate amount of space between the title and the popup.                        
  1081. ;                                                                                         
  1082.  
  1083.                                                             ; Theme Popup Button proc IDs 
  1084. kControlPopupButtonProc            EQU        400
  1085. kControlPopupFixedWidthVariant    EQU        $01
  1086. kControlPopupVariableWidthVariant EQU    $02
  1087. kControlPopupUseAddResMenuVariant EQU    $04
  1088. kControlPopupUseWFontVariant    EQU        $08                    ; kControlUsesOwningWindowsFontVariant
  1089. ;  These tags are available in 1.0.1 or later of Appearance 
  1090.  
  1091. kControlPopupButtonMenuHandleTag EQU    'mhan'                ; MenuHandle
  1092. kControlPopupButtonMenuIDTag    EQU        'mnid'                ; SInt16
  1093. ;  These tags are available in 1.1 or later of Appearance 
  1094.  
  1095. kControlPopupButtonExtraHeightTag EQU    'exht'                ; SInt16 extra vertical whitespace within the button
  1096.  
  1097. ; ——————————————————————————————————————————————————————————————————————————————————————
  1098. ;     • RADIO GROUP (CDEF 26)                                                                
  1099. ; ——————————————————————————————————————————————————————————————————————————————————————
  1100. ;     This control implements a radio group. It is an embedding control and can therefore    
  1101. ;      only be used when a control hierarchy is established for its owning window. You        
  1102. ;     should only embed radio buttons within it. As radio buttons are embedded into it,    
  1103. ;     the group sets up its value, min, and max to represent the number of embedded items.
  1104. ;     The current value of the control is the index of the sub-control that is the current
  1105. ;     'on' radio button. To get the current radio button control handle, you can use the    
  1106. ;     control manager call GetIndSubControl, passing in the value of the radio group.        
  1107. ;                                                                                         
  1108. ;     NOTE: This control is only available with Appearance 1.0.1.                            
  1109.  
  1110. kControlRadioGroupProc            EQU        416
  1111. ; ——————————————————————————————————————————————————————————————————————————————————————
  1112. ;     • SCROLL TEXT BOX (CDEF 27)                                                            
  1113. ; ——————————————————————————————————————————————————————————————————————————————————————
  1114. ;     This control implements a scrolling box of (non-editable) text.    This is useful for    
  1115. ;     credits in about boxes, etc.                                                        
  1116. ;     The standard version of this control has a scroll bar, but the autoscrolling        
  1117. ;     variant does not. The autoscrolling variant needs two pieces of information to        
  1118. ;     work: delay (in ticks) before the scrolling starts, and time (in ticks) between        
  1119. ;     scrolls. It will scroll one pixel at a time, unless changed via SetControlData.        
  1120. ;                                                                                         
  1121. ;     Parameter                    What Goes Here                                            
  1122. ;     ———————————————————            ————————————————————————————————————————————————————    
  1123. ;     Value                        Resource ID of 'TEXT'/'styl' content.                    
  1124. ;     Min                            Scroll start delay (in ticks)                        .    
  1125. ;     Max                            Delay (in ticks) between scrolls.                        
  1126. ;                                                                                         
  1127. ;     NOTE: This control is only available with Appearance 1.1.                            
  1128.  
  1129. kControlScrollTextBoxProc        EQU        432
  1130. kControlScrollTextBoxAutoScrollProc EQU    433
  1131.  
  1132. kControlScrollTextBoxDelayBeforeAutoScrollTag EQU 'stdl'    ; UInt32 (ticks until autoscrolling starts)
  1133. kControlScrollTextBoxDelayBetweenAutoScrollTag EQU 'scdl'    ; UInt32 (ticks between scrolls)
  1134. kControlScrollTextBoxAutoScrollAmountTag EQU 'samt'            ; UInt16 (pixels per scroll) -- defaults to 1
  1135. kControlScrollTextBoxContentsTag EQU    'tres'                ; SInt16 (resource ID of 'TEXT'/'styl') -- write only!
  1136.  
  1137. ;   —— end of stuff only available with Appearance 1.0 and later
  1138.  
  1139.  
  1140. ; ——————————————————————————————————————————————————————————————————————————————————————
  1141. ;     • Control Variants                                                                    
  1142. ; ——————————————————————————————————————————————————————————————————————————————————————
  1143. ; typedef SInt16                         ControlVariant
  1144.  
  1145.  
  1146. kControlNoVariant                EQU        0                    ; No variant
  1147. kControlUsesOwningWindowsFontVariant EQU $08                ; Control uses owning windows font to display text
  1148. ; ——————————————————————————————————————————————————————————————————————————————————————
  1149. ;     • Control Part Codes                                                                
  1150. ; ——————————————————————————————————————————————————————————————————————————————————————
  1151.  
  1152. kControlNoPart                    EQU        0
  1153. kControlLabelPart                EQU        1
  1154. kControlMenuPart                EQU        2
  1155. kControlTrianglePart            EQU        4
  1156. kControlEditTextPart            EQU        5                    ; Appearance 1.0 and later
  1157. kControlPicturePart                EQU        6                    ; Appearance 1.0 and later
  1158. kControlIconPart                EQU        7                    ; Appearance 1.0 and later
  1159. kControlClockPart                EQU        8                    ; Appearance 1.0 and later
  1160. kControlListBoxPart                EQU        24                    ; Appearance 1.0 and later
  1161. kControlListBoxDoubleClickPart    EQU        25                    ; Appearance 1.0 and later
  1162. kControlImageWellPart            EQU        26                    ; Appearance 1.0 and later
  1163. kControlRadioGroupPart            EQU        27                    ; Appearance 1.0.2 and later
  1164. kControlButtonPart                EQU        10
  1165. kControlCheckBoxPart            EQU        11
  1166. kControlRadioButtonPart            EQU        11
  1167. kControlUpButtonPart            EQU        20
  1168. kControlDownButtonPart            EQU        21
  1169. kControlPageUpPart                EQU        22
  1170. kControlPageDownPart            EQU        23
  1171. kControlIndicatorPart            EQU        129
  1172. kControlDisabledPart            EQU        254
  1173. kControlInactivePart            EQU        255
  1174.  
  1175. kControlClockHourDayPart        EQU        9                    ; Appearance 1.1 and later
  1176. kControlClockMinuteMonthPart    EQU        10                    ; Appearance 1.1 and later
  1177. kControlClockSecondYearPart        EQU        11                    ; Appearance 1.1 and later
  1178. kControlClockAMPMPart            EQU        12                    ; Appearance 1.1 and later
  1179. ; ——————————————————————————————————————————————————————————————————————————————————————
  1180. ;      Meta-Parts                                                                            
  1181. ;/*     If you haven't guessed from looking at other toolbox headers. We like the word         
  1182. ;     'meta'. It's cool. So here's one more for you. A meta-part is a part used in a call    
  1183. ;      to the GetControlRegion API. These parts are parts that might be defined by a        
  1184. ;     control, but should not be returned from calls like TestControl, et al. They define    
  1185. ;      a region of a control, presently the structure and the content region. The content    
  1186. ;      region is only defined by controls that can embed other controls. It is the area    
  1187. ;      that embedded content can live.                                                        
  1188. ;                                                                                         
  1189. ;     Along with these parts, you can also pass in normal part codes to get the regions    
  1190. ;      of the parts. Not all controls fully support this at the time this was written.        
  1191. ; ——————————————————————————————————————————————————————————————————————————————————————
  1192.  
  1193. kControlStructureMetaPart        EQU        -1
  1194. kControlContentMetaPart            EQU        -2
  1195.  
  1196. ; ——————————————————————————————————————————————————————————————————————————————————————
  1197. ;     • Check Box Values                                                                    
  1198. ; ——————————————————————————————————————————————————————————————————————————————————————
  1199.  
  1200. kControlCheckBoxUncheckedValue    EQU        0
  1201. kControlCheckBoxCheckedValue    EQU        1
  1202. kControlCheckBoxMixedValue        EQU        2
  1203. ; ——————————————————————————————————————————————————————————————————————————————————————
  1204. ;     • Radio Button Values                                                                
  1205. ; ——————————————————————————————————————————————————————————————————————————————————————
  1206.  
  1207. kControlRadioButtonUncheckedValue EQU    0
  1208. kControlRadioButtonCheckedValue    EQU        1
  1209. kControlRadioButtonMixedValue    EQU        2
  1210. ; ——————————————————————————————————————————————————————————————————————————————————————
  1211. ;     • Pop-Up Menu Control Constants                                                        
  1212. ; ——————————————————————————————————————————————————————————————————————————————————————
  1213. ;  Variant codes for the System 7 pop-up menu
  1214.  
  1215. popupFixedWidth                    EQU        $01
  1216. popupVariableWidth                EQU        $02
  1217. popupUseAddResMenu                EQU        $04
  1218. popupUseWFont                    EQU        $08
  1219. ;  Menu label styles for the System 7 pop-up menu
  1220.  
  1221. popupTitleBold                    EQU        $0100
  1222. popupTitleItalic                EQU        $0200
  1223. popupTitleUnderline                EQU        $0400
  1224. popupTitleOutline                EQU        $0800
  1225. popupTitleShadow                EQU        $1000
  1226. popupTitleCondense                EQU        $2000
  1227. popupTitleExtend                EQU        $4000
  1228. popupTitleNoStyle                EQU        $8000
  1229. ;  Menu label justifications for the System 7 pop-up menu
  1230.  
  1231. popupTitleLeftJust                EQU        $00000000
  1232. popupTitleCenterJust            EQU        $00000001
  1233. popupTitleRightJust                EQU        $000000FF
  1234. ; ——————————————————————————————————————————————————————————————————————————————————————
  1235. ;      • DragGrayRgn Constatns                                                                
  1236. ;                                                                                         
  1237. ;    For DragGrayRgnUPP used in TrackControl()                                             
  1238. ; ——————————————————————————————————————————————————————————————————————————————————————
  1239.  
  1240. noConstraint                    EQU        0
  1241. hAxisOnly                        EQU        1
  1242. vAxisOnly                        EQU        2
  1243. ; ——————————————————————————————————————————————————————————————————————————————————————
  1244. ;     • Control Creation/Deletion                                                            
  1245. ; ——————————————————————————————————————————————————————————————————————————————————————
  1246. ;
  1247. ; pascal ControlHandle NewControl(WindowPtr owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference)
  1248. ;
  1249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1250.         _NewControl:    OPWORD    $A954
  1251.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1252.         IMPORT_CFM_FUNCTION NewControl
  1253.     ENDIF
  1254.  
  1255. ;
  1256. ; pascal ControlHandle GetNewControl(SInt16 resourceID, WindowPtr owningWindow)
  1257. ;
  1258.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1259.         _GetNewControl:    OPWORD    $A9BE
  1260.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1261.         IMPORT_CFM_FUNCTION GetNewControl
  1262.     ENDIF
  1263.  
  1264. ;
  1265. ; pascal void DisposeControl(ControlHandle theControl)
  1266. ;
  1267.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1268.         _DisposeControl:    OPWORD    $A955
  1269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1270.         IMPORT_CFM_FUNCTION DisposeControl
  1271.     ENDIF
  1272.  
  1273. ;
  1274. ; pascal void KillControls(WindowPtr theWindow)
  1275. ;
  1276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1277.         _KillControls:    OPWORD    $A956
  1278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1279.         IMPORT_CFM_FUNCTION KillControls
  1280.     ENDIF
  1281.  
  1282. ; ——————————————————————————————————————————————————————————————————————————————————————
  1283. ;     • Control Visible State                                                                
  1284. ; ——————————————————————————————————————————————————————————————————————————————————————
  1285. ;
  1286. ; pascal void HiliteControl(ControlHandle theControl, ControlPartCode hiliteState)
  1287. ;
  1288.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1289.         _HiliteControl:    OPWORD    $A95D
  1290.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1291.         IMPORT_CFM_FUNCTION HiliteControl
  1292.     ENDIF
  1293.  
  1294. ;
  1295. ; pascal void ShowControl(ControlHandle theControl)
  1296. ;
  1297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1298.         _ShowControl:    OPWORD    $A957
  1299.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1300.         IMPORT_CFM_FUNCTION ShowControl
  1301.     ENDIF
  1302.  
  1303. ;
  1304. ; pascal void HideControl(ControlHandle theControl)
  1305. ;
  1306.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1307.         _HideControl:    OPWORD    $A958
  1308.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1309.         IMPORT_CFM_FUNCTION HideControl
  1310.     ENDIF
  1311.  
  1312.  
  1313. ;  following state routines available only with Appearance 1.0 and later
  1314. ;
  1315. ; pascal Boolean IsControlActive(ControlHandle inControl)
  1316. ;
  1317.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1318.         Macro
  1319.         _IsControlActive
  1320.             move.w              #$0005,D0
  1321.             dc.w                $AA73
  1322.         EndM
  1323.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1324.         IMPORT_CFM_FUNCTION IsControlActive
  1325.     ENDIF
  1326.  
  1327. ;
  1328. ; pascal Boolean IsControlVisible(ControlHandle inControl)
  1329. ;
  1330.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1331.         Macro
  1332.         _IsControlVisible
  1333.             move.w              #$0006,D0
  1334.             dc.w                $AA73
  1335.         EndM
  1336.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1337.         IMPORT_CFM_FUNCTION IsControlVisible
  1338.     ENDIF
  1339.  
  1340. ;
  1341. ; pascal OSErr ActivateControl(ControlHandle inControl)
  1342. ;
  1343.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1344.         Macro
  1345.         _ActivateControl
  1346.             move.w              #$0007,D0
  1347.             dc.w                $AA73
  1348.         EndM
  1349.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1350.         IMPORT_CFM_FUNCTION ActivateControl
  1351.     ENDIF
  1352.  
  1353. ;
  1354. ; pascal OSErr DeactivateControl(ControlHandle inControl)
  1355. ;
  1356.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1357.         Macro
  1358.         _DeactivateControl
  1359.             move.w              #$0008,D0
  1360.             dc.w                $AA73
  1361.         EndM
  1362.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1363.         IMPORT_CFM_FUNCTION DeactivateControl
  1364.     ENDIF
  1365.  
  1366. ;
  1367. ; pascal OSErr SetControlVisibility(ControlHandle inControl, Boolean inIsVisible, Boolean inDoDraw)
  1368. ;
  1369.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1370.         Macro
  1371.         _SetControlVisibility
  1372.             move.w              #$001E,D0
  1373.             dc.w                $AA73
  1374.         EndM
  1375.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1376.         IMPORT_CFM_FUNCTION SetControlVisibility
  1377.     ENDIF
  1378.  
  1379.  
  1380. ; ——————————————————————————————————————————————————————————————————————————————————————
  1381. ;     • Control Imaging                                                                    
  1382. ; ——————————————————————————————————————————————————————————————————————————————————————
  1383. ;
  1384. ; pascal void DrawControls(WindowPtr theWindow)
  1385. ;
  1386.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1387.         _DrawControls:    OPWORD    $A969
  1388.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1389.         IMPORT_CFM_FUNCTION DrawControls
  1390.     ENDIF
  1391.  
  1392. ;
  1393. ; pascal void Draw1Control(ControlHandle theControl)
  1394. ;
  1395.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1396.         _Draw1Control:    OPWORD    $A96D
  1397.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1398.         IMPORT_CFM_FUNCTION Draw1Control
  1399.     ENDIF
  1400.  
  1401.  
  1402. ;
  1403. ; pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRegion)
  1404. ;
  1405.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1406.         _UpdateControls:    OPWORD    $A953
  1407.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1408.         IMPORT_CFM_FUNCTION UpdateControls
  1409.     ENDIF
  1410.  
  1411.  
  1412. ;  following imaging routines available only with Appearance 1.0 and later
  1413. ;
  1414. ; pascal OSErr GetBestControlRect(ControlHandle inControl, Rect *outRect, SInt16 *outBaseLineOffset)
  1415. ;
  1416.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1417.         Macro
  1418.         _GetBestControlRect
  1419.             move.w              #$001B,D0
  1420.             dc.w                $AA73
  1421.         EndM
  1422.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1423.         IMPORT_CFM_FUNCTION GetBestControlRect
  1424.     ENDIF
  1425.  
  1426. ;
  1427. ; pascal OSErr SetControlFontStyle(ControlHandle inControl, const ControlFontStyleRec *inStyle)
  1428. ;
  1429.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1430.         Macro
  1431.         _SetControlFontStyle
  1432.             move.w              #$001C,D0
  1433.             dc.w                $AA73
  1434.         EndM
  1435.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1436.         IMPORT_CFM_FUNCTION SetControlFontStyle
  1437.     ENDIF
  1438.  
  1439. ;
  1440. ; pascal void DrawControlInCurrentPort(ControlHandle inControl)
  1441. ;
  1442.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1443.         Macro
  1444.         _DrawControlInCurrentPort
  1445.             move.w              #$0018,D0
  1446.             dc.w                $AA73
  1447.         EndM
  1448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1449.         IMPORT_CFM_FUNCTION DrawControlInCurrentPort
  1450.     ENDIF
  1451.  
  1452. ;
  1453. ; pascal OSErr SetUpControlBackground(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1454. ;
  1455.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1456.         Macro
  1457.         _SetUpControlBackground
  1458.             move.w              #$001D,D0
  1459.             dc.w                $AA73
  1460.         EndM
  1461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1462.         IMPORT_CFM_FUNCTION SetUpControlBackground
  1463.     ENDIF
  1464.  
  1465. ;  SetUpControlTextColor is available in Appearance 1.1 or later.
  1466. ;
  1467. ; pascal OSErr SetUpControlTextColor(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1468. ;
  1469.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1470.         IMPORT_CFM_FUNCTION SetUpControlTextColor
  1471.     ENDIF
  1472.  
  1473.  
  1474. ; ——————————————————————————————————————————————————————————————————————————————————————
  1475. ;     • Control Mousing                                                                    
  1476. ; ——————————————————————————————————————————————————————————————————————————————————————
  1477. ;    NOTE ON CONTROL ACTION PROCS
  1478. ;
  1479. ;    When using the TrackControl() call when tracking an indicator, the actionProc parameter
  1480. ;    (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
  1481. ;    (see Quickdraw.h).
  1482. ;
  1483. ;    If, however, you are using the live feedback variants of scroll bars or sliders, you
  1484. ;    can pass a ControlActionUPP in when tracking the indicator as well. This functionality
  1485. ;    is available in Appearance 1.0 or later.
  1486. ;
  1487.  
  1488. ;
  1489. ; pascal ControlPartCode TrackControl(ControlHandle theControl, Point startPoint, ControlActionUPP actionProc)
  1490. ;
  1491.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1492.         _TrackControl:    OPWORD    $A968
  1493.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1494.         IMPORT_CFM_FUNCTION TrackControl
  1495.     ENDIF
  1496.  
  1497. ;
  1498. ; pascal void DragControl(ControlHandle theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  1499. ;
  1500.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1501.         _DragControl:    OPWORD    $A967
  1502.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1503.         IMPORT_CFM_FUNCTION DragControl
  1504.     ENDIF
  1505.  
  1506. ;
  1507. ; pascal ControlPartCode TestControl(ControlHandle theControl, Point testPoint)
  1508. ;
  1509.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1510.         _TestControl:    OPWORD    $A966
  1511.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1512.         IMPORT_CFM_FUNCTION TestControl
  1513.     ENDIF
  1514.  
  1515. ;
  1516. ; pascal ControlPartCode FindControl(Point testPoint, WindowPtr theWindow, ControlHandle *theControl)
  1517. ;
  1518.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1519.         _FindControl:    OPWORD    $A96C
  1520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1521.         IMPORT_CFM_FUNCTION FindControl
  1522.     ENDIF
  1523.  
  1524. ;  The following mousing routines available only with Appearance 1.0 and later    
  1525. ;                                                                                 
  1526. ;  FindControlUnderMouse is preferrable to TrackControl when running under        
  1527. ;  Appearance 1.0 as you can pass in modifiers, which some of the new controls    
  1528. ;  use, such as edit text and list boxes.                                        
  1529. ;
  1530. ; pascal ControlHandle FindControlUnderMouse(Point inWhere, WindowPtr inWindow, SInt16 *outPart)
  1531. ;
  1532.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1533.         Macro
  1534.         _FindControlUnderMouse
  1535.             move.w              #$0009,D0
  1536.             dc.w                $AA73
  1537.         EndM
  1538.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1539.         IMPORT_CFM_FUNCTION FindControlUnderMouse
  1540.     ENDIF
  1541.  
  1542. ;
  1543. ; pascal ControlPartCode HandleControlClick(ControlHandle inControl, Point inWhere, SInt16 inModifiers, ControlActionUPP inAction)
  1544. ;
  1545.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1546.         Macro
  1547.         _HandleControlClick
  1548.             move.w              #$000A,D0
  1549.             dc.w                $AA73
  1550.         EndM
  1551.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1552.         IMPORT_CFM_FUNCTION HandleControlClick
  1553.     ENDIF
  1554.  
  1555.  
  1556.  
  1557.  
  1558. ; ——————————————————————————————————————————————————————————————————————————————————————
  1559. ;     • Control Events (available only with Appearance 1.0 and later)                        
  1560. ; ——————————————————————————————————————————————————————————————————————————————————————
  1561. ;
  1562. ; pascal SInt16 HandleControlKey(ControlHandle inControl, SInt16 inKeyCode, SInt16 inCharCode, SInt16 inModifiers)
  1563. ;
  1564.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1565.         Macro
  1566.         _HandleControlKey
  1567.             move.w              #$000B,D0
  1568.             dc.w                $AA73
  1569.         EndM
  1570.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1571.         IMPORT_CFM_FUNCTION HandleControlKey
  1572.     ENDIF
  1573.  
  1574. ;
  1575. ; pascal void IdleControls(WindowPtr inWindow)
  1576. ;
  1577.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1578.         Macro
  1579.         _IdleControls
  1580.             move.w              #$000C,D0
  1581.             dc.w                $AA73
  1582.         EndM
  1583.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1584.         IMPORT_CFM_FUNCTION IdleControls
  1585.     ENDIF
  1586.  
  1587.  
  1588.  
  1589. ; ——————————————————————————————————————————————————————————————————————————————————————
  1590. ;     • Control Positioning                                                                
  1591. ; ——————————————————————————————————————————————————————————————————————————————————————
  1592. ;
  1593. ; pascal void MoveControl(ControlHandle theControl, SInt16 h, SInt16 v)
  1594. ;
  1595.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1596.         _MoveControl:    OPWORD    $A959
  1597.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1598.         IMPORT_CFM_FUNCTION MoveControl
  1599.     ENDIF
  1600.  
  1601. ;
  1602. ; pascal void SizeControl(ControlHandle theControl, SInt16 w, SInt16 h)
  1603. ;
  1604.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1605.         _SizeControl:    OPWORD    $A95C
  1606.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1607.         IMPORT_CFM_FUNCTION SizeControl
  1608.     ENDIF
  1609.  
  1610. ; ——————————————————————————————————————————————————————————————————————————————————————
  1611. ;     • Control Title                                                                        
  1612. ; ——————————————————————————————————————————————————————————————————————————————————————
  1613. ;
  1614. ; pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title)
  1615. ;
  1616.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1617.         _SetControlTitle:    OPWORD    $A95F
  1618.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1619.         IMPORT_CFM_FUNCTION SetControlTitle
  1620.     ENDIF
  1621.  
  1622. ;
  1623. ; pascal void GetControlTitle(ControlHandle theControl, Str255 title)
  1624. ;
  1625.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1626.         _GetControlTitle:    OPWORD    $A95E
  1627.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1628.         IMPORT_CFM_FUNCTION GetControlTitle
  1629.     ENDIF
  1630.  
  1631. ; ——————————————————————————————————————————————————————————————————————————————————————
  1632. ;     • Control Value                                                                        
  1633. ; ——————————————————————————————————————————————————————————————————————————————————————
  1634. ;
  1635. ; pascal SInt16 GetControlValue(ControlHandle theControl)
  1636. ;
  1637.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1638.         _GetControlValue:    OPWORD    $A960
  1639.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1640.         IMPORT_CFM_FUNCTION GetControlValue
  1641.     ENDIF
  1642.  
  1643. ;
  1644. ; pascal void SetControlValue(ControlHandle theControl, SInt16 newValue)
  1645. ;
  1646.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1647.         _SetControlValue:    OPWORD    $A963
  1648.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1649.         IMPORT_CFM_FUNCTION SetControlValue
  1650.     ENDIF
  1651.  
  1652. ;
  1653. ; pascal SInt16 GetControlMinimum(ControlHandle theControl)
  1654. ;
  1655.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1656.         _GetControlMinimum:    OPWORD    $A961
  1657.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1658.         IMPORT_CFM_FUNCTION GetControlMinimum
  1659.     ENDIF
  1660.  
  1661. ;
  1662. ; pascal void SetControlMinimum(ControlHandle theControl, SInt16 newMinimum)
  1663. ;
  1664.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1665.         _SetControlMinimum:    OPWORD    $A964
  1666.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1667.         IMPORT_CFM_FUNCTION SetControlMinimum
  1668.     ENDIF
  1669.  
  1670. ;
  1671. ; pascal SInt16 GetControlMaximum(ControlHandle theControl)
  1672. ;
  1673.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1674.         _GetControlMaximum:    OPWORD    $A962
  1675.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1676.         IMPORT_CFM_FUNCTION GetControlMaximum
  1677.     ENDIF
  1678.  
  1679. ;
  1680. ; pascal void SetControlMaximum(ControlHandle theControl, SInt16 newMaximum)
  1681. ;
  1682.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1683.         _SetControlMaximum:    OPWORD    $A965
  1684.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1685.         IMPORT_CFM_FUNCTION SetControlMaximum
  1686.     ENDIF
  1687.  
  1688.  
  1689. ;  proportional scrolling/32-bit value support is new with Appearance 1.1
  1690.  
  1691. ;
  1692. ; pascal SInt32 GetControlViewSize(ControlHandle theControl)
  1693. ;
  1694.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1695.         IMPORT_CFM_FUNCTION GetControlViewSize
  1696.     ENDIF
  1697.  
  1698. ;
  1699. ; pascal void SetControlViewSize(ControlHandle theControl, SInt32 newViewSize)
  1700. ;
  1701.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1702.         IMPORT_CFM_FUNCTION SetControlViewSize
  1703.     ENDIF
  1704.  
  1705. ;
  1706. ; pascal SInt32 GetControl32BitValue(ControlHandle theControl)
  1707. ;
  1708.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1709.         IMPORT_CFM_FUNCTION GetControl32BitValue
  1710.     ENDIF
  1711.  
  1712. ;
  1713. ; pascal void SetControl32BitValue(ControlHandle theControl, SInt32 newValue)
  1714. ;
  1715.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1716.         IMPORT_CFM_FUNCTION SetControl32BitValue
  1717.     ENDIF
  1718.  
  1719. ;
  1720. ; pascal SInt32 GetControl32BitMaximum(ControlHandle theControl)
  1721. ;
  1722.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1723.         IMPORT_CFM_FUNCTION GetControl32BitMaximum
  1724.     ENDIF
  1725.  
  1726. ;
  1727. ; pascal void SetControl32BitMaximum(ControlHandle theControl, SInt32 newMaximum)
  1728. ;
  1729.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1730.         IMPORT_CFM_FUNCTION SetControl32BitMaximum
  1731.     ENDIF
  1732.  
  1733. ;
  1734. ; pascal SInt32 GetControl32BitMinimum(ControlHandle theControl)
  1735. ;
  1736.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1737.         IMPORT_CFM_FUNCTION GetControl32BitMinimum
  1738.     ENDIF
  1739.  
  1740. ;
  1741. ; pascal void SetControl32BitMinimum(ControlHandle theControl, SInt32 newMinimum)
  1742. ;
  1743.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1744.         IMPORT_CFM_FUNCTION SetControl32BitMinimum
  1745.     ENDIF
  1746.  
  1747.  
  1748. ;       IsValidControlHandle will tell you if the handle you pass in belongs to a control
  1749. ;      the Control Manager knows about. It does not sanity check the data in the control.
  1750.  
  1751.  
  1752.  
  1753. ;
  1754. ; pascal Boolean IsValidControlHandle(ControlHandle theControl)
  1755. ;
  1756.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1757.         IMPORT_CFM_FUNCTION IsValidControlHandle
  1758.     ENDIF
  1759.  
  1760. ; ——————————————————————————————————————————————————————————————————————————————————————
  1761. ;  • Properties                                                                            
  1762. ; ——————————————————————————————————————————————————————————————————————————————————————
  1763. ;
  1764. ; pascal OSStatus GetControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  1765. ;
  1766.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1767.         IMPORT_CFM_FUNCTION GetControlProperty
  1768.     ENDIF
  1769.  
  1770. ;
  1771. ; pascal OSStatus GetControlPropertySize(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 *size)
  1772. ;
  1773.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1774.         IMPORT_CFM_FUNCTION GetControlPropertySize
  1775.     ENDIF
  1776.  
  1777. ;
  1778. ; pascal OSStatus SetControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData)
  1779. ;
  1780.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1781.         IMPORT_CFM_FUNCTION SetControlProperty
  1782.     ENDIF
  1783.  
  1784. ;
  1785. ; pascal OSStatus RemoveControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag)
  1786. ;
  1787.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1788.         IMPORT_CFM_FUNCTION RemoveControlProperty
  1789.     ENDIF
  1790.  
  1791.  
  1792. ; ——————————————————————————————————————————————————————————————————————————————————————
  1793. ;     • Control Regions (Appearance 1.1 or later)                                            
  1794. ;                                                                                         
  1795. ;     See the discussion on meta-parts in this header for more information                
  1796. ; ——————————————————————————————————————————————————————————————————————————————————————
  1797. ;
  1798. ; pascal OSStatus GetControlRegion(ControlHandle inControl, ControlPartCode inPart, RgnHandle outRegion)
  1799. ;
  1800.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1801.         IMPORT_CFM_FUNCTION GetControlRegion
  1802.     ENDIF
  1803.  
  1804.  
  1805.  
  1806. ; ——————————————————————————————————————————————————————————————————————————————————————
  1807. ;     • Control Variant                                                                    
  1808. ; ——————————————————————————————————————————————————————————————————————————————————————
  1809. ;
  1810. ; pascal ControlVariant GetControlVariant(ControlHandle theControl)
  1811. ;
  1812.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1813.         _GetControlVariant:    OPWORD    $A809
  1814.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1815.         IMPORT_CFM_FUNCTION GetControlVariant
  1816.     ENDIF
  1817.  
  1818. ; ——————————————————————————————————————————————————————————————————————————————————————
  1819. ;     • Control Action                                                                    
  1820. ; ——————————————————————————————————————————————————————————————————————————————————————
  1821. ;
  1822. ; pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc)
  1823. ;
  1824.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1825.         _SetControlAction:    OPWORD    $A96B
  1826.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1827.         IMPORT_CFM_FUNCTION SetControlAction
  1828.     ENDIF
  1829.  
  1830. ;
  1831. ; pascal ControlActionUPP GetControlAction(ControlHandle theControl)
  1832. ;
  1833.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1834.         _GetControlAction:    OPWORD    $A96A
  1835.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1836.         IMPORT_CFM_FUNCTION GetControlAction
  1837.     ENDIF
  1838.  
  1839. ; ——————————————————————————————————————————————————————————————————————————————————————
  1840. ;  • Control Accessors                                                                    
  1841. ; ——————————————————————————————————————————————————————————————————————————————————————
  1842. ;
  1843. ; pascal void SetControlReference(ControlHandle theControl, SInt32 data)
  1844. ;
  1845.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1846.         _SetControlReference:    OPWORD    $A95B
  1847.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1848.         IMPORT_CFM_FUNCTION SetControlReference
  1849.     ENDIF
  1850.  
  1851. ;
  1852. ; pascal SInt32 GetControlReference(ControlHandle theControl)
  1853. ;
  1854.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1855.         _GetControlReference:    OPWORD    $A95A
  1856.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1857.         IMPORT_CFM_FUNCTION GetControlReference
  1858.     ENDIF
  1859.  
  1860. ;
  1861. ; pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl)
  1862. ;
  1863.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1864.         _GetAuxiliaryControlRecord:    OPWORD    $AA44
  1865.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1866.         IMPORT_CFM_FUNCTION GetAuxiliaryControlRecord
  1867.     ENDIF
  1868.  
  1869. ;
  1870. ; pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable)
  1871. ;
  1872.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1873.         _SetControlColor:    OPWORD    $AA43
  1874.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1875.         IMPORT_CFM_FUNCTION SetControlColor
  1876.     ENDIF
  1877.  
  1878. ; ——————————————————————————————————————————————————————————————————————————————————————
  1879. ;     • HELPERS (available only with Appearance 1.0 and later)                            
  1880. ;                                                                                         
  1881. ;  These routines are available only thru the shared library/glue                        
  1882. ;  Bevel button routines                                                                
  1883. ; ——————————————————————————————————————————————————————————————————————————————————————
  1884.  
  1885. ;
  1886. ; pascal OSErr GetBevelButtonMenuValue(ControlHandle inButton, SInt16 *outValue)
  1887. ;
  1888.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1889.         IMPORT_CFM_FUNCTION GetBevelButtonMenuValue
  1890.     ENDIF
  1891.  
  1892. ;
  1893. ; pascal OSErr SetBevelButtonMenuValue(ControlHandle inButton, SInt16 inValue)
  1894. ;
  1895.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1896.         IMPORT_CFM_FUNCTION SetBevelButtonMenuValue
  1897.     ENDIF
  1898.  
  1899. ;
  1900. ; pascal OSErr GetBevelButtonMenuHandle(ControlHandle inButton, MenuHandle *outHandle)
  1901. ;
  1902.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1903.         IMPORT_CFM_FUNCTION GetBevelButtonMenuHandle
  1904.     ENDIF
  1905.  
  1906. ;
  1907. ; pascal OSErr GetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1908. ;
  1909.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1910.         IMPORT_CFM_FUNCTION GetBevelButtonContentInfo
  1911.     ENDIF
  1912.  
  1913. ;
  1914. ; pascal OSErr SetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1915. ;
  1916.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1917.         IMPORT_CFM_FUNCTION SetBevelButtonContentInfo
  1918.     ENDIF
  1919.  
  1920. ;
  1921. ; pascal OSErr SetBevelButtonTransform(ControlHandle inButton, IconTransformType transform)
  1922. ;
  1923.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1924.         IMPORT_CFM_FUNCTION SetBevelButtonTransform
  1925.     ENDIF
  1926.  
  1927. ;
  1928. ; pascal OSErr SetBevelButtonGraphicAlignment(ControlHandle inButton, ControlButtonGraphicAlignment inAlign, SInt16 inHOffset, SInt16 inVOffset)
  1929. ;
  1930.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1931.         IMPORT_CFM_FUNCTION SetBevelButtonGraphicAlignment
  1932.     ENDIF
  1933.  
  1934. ;
  1935. ; pascal OSErr SetBevelButtonTextAlignment(ControlHandle inButton, ControlButtonTextAlignment inAlign, SInt16 inHOffset)
  1936. ;
  1937.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1938.         IMPORT_CFM_FUNCTION SetBevelButtonTextAlignment
  1939.     ENDIF
  1940.  
  1941. ;
  1942. ; pascal OSErr SetBevelButtonTextPlacement(ControlHandle inButton, ControlButtonTextPlacement inWhere)
  1943. ;
  1944.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1945.         IMPORT_CFM_FUNCTION SetBevelButtonTextPlacement
  1946.     ENDIF
  1947.  
  1948. ;  Image well routines
  1949.  
  1950. ;
  1951. ; pascal OSErr GetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1952. ;
  1953.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1954.         IMPORT_CFM_FUNCTION GetImageWellContentInfo
  1955.     ENDIF
  1956.  
  1957. ;
  1958. ; pascal OSErr SetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1959. ;
  1960.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1961.         IMPORT_CFM_FUNCTION SetImageWellContentInfo
  1962.     ENDIF
  1963.  
  1964. ;
  1965. ; pascal OSErr SetImageWellTransform(ControlHandle inButton, IconTransformType inTransform)
  1966. ;
  1967.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1968.         IMPORT_CFM_FUNCTION SetImageWellTransform
  1969.     ENDIF
  1970.  
  1971. ;  Tab routines
  1972.  
  1973. ;
  1974. ; pascal OSErr GetTabContentRect(ControlHandle inTabControl, Rect *outContentRect)
  1975. ;
  1976.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1977.         IMPORT_CFM_FUNCTION GetTabContentRect
  1978.     ENDIF
  1979.  
  1980. ;
  1981. ; pascal OSErr SetTabEnabled(ControlHandle inTabControl, SInt16 inTabToHilite, Boolean inEnabled)
  1982. ;
  1983.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1984.         IMPORT_CFM_FUNCTION SetTabEnabled
  1985.     ENDIF
  1986.  
  1987. ;  Disclosure triangles
  1988.  
  1989. ;
  1990. ; pascal OSErr SetDisclosureTriangleLastValue(ControlHandle inTabControl, SInt16 inValue)
  1991. ;
  1992.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1993.         IMPORT_CFM_FUNCTION SetDisclosureTriangleLastValue
  1994.     ENDIF
  1995.  
  1996. ; ——————————————————————————————————————————————————————————————————————————————————————
  1997. ;     • Control Hierarchy (Appearance 1.0 and later only)                                    
  1998. ; ——————————————————————————————————————————————————————————————————————————————————————
  1999. ;
  2000. ; pascal SInt32 SendControlMessage(ControlHandle inControl, SInt16 inMessage, SInt32 inParam)
  2001. ;
  2002.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2003.         Macro
  2004.         _SendControlMessage
  2005.             move.w              #$FFFE,D0
  2006.             dc.w                $AA73
  2007.         EndM
  2008.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2009.         IMPORT_CFM_FUNCTION SendControlMessage
  2010.     ENDIF
  2011.  
  2012. ;
  2013. ; pascal OSErr DumpControlHierarchy(WindowPtr inWindow, const FSSpec *inDumpFile)
  2014. ;
  2015.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2016.         Macro
  2017.         _DumpControlHierarchy
  2018.             move.w              #$FFFF,D0
  2019.             dc.w                $AA73
  2020.         EndM
  2021.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2022.         IMPORT_CFM_FUNCTION DumpControlHierarchy
  2023.     ENDIF
  2024.  
  2025. ;
  2026. ; pascal OSErr CreateRootControl(WindowPtr inWindow, ControlHandle *outControl)
  2027. ;
  2028.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2029.         Macro
  2030.         _CreateRootControl
  2031.             move.w              #$0001,D0
  2032.             dc.w                $AA73
  2033.         EndM
  2034.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2035.         IMPORT_CFM_FUNCTION CreateRootControl
  2036.     ENDIF
  2037.  
  2038. ;
  2039. ; pascal OSErr GetRootControl(WindowPtr inWindow, ControlHandle *outControl)
  2040. ;
  2041.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2042.         Macro
  2043.         _GetRootControl
  2044.             move.w              #$0002,D0
  2045.             dc.w                $AA73
  2046.         EndM
  2047.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2048.         IMPORT_CFM_FUNCTION GetRootControl
  2049.     ENDIF
  2050.  
  2051. ;
  2052. ; pascal OSErr EmbedControl(ControlHandle inControl, ControlHandle inContainer)
  2053. ;
  2054.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2055.         Macro
  2056.         _EmbedControl
  2057.             move.w              #$0003,D0
  2058.             dc.w                $AA73
  2059.         EndM
  2060.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2061.         IMPORT_CFM_FUNCTION EmbedControl
  2062.     ENDIF
  2063.  
  2064. ;
  2065. ; pascal OSErr AutoEmbedControl(ControlHandle inControl, WindowPtr inWindow)
  2066. ;
  2067.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2068.         Macro
  2069.         _AutoEmbedControl
  2070.             move.w              #$0004,D0
  2071.             dc.w                $AA73
  2072.         EndM
  2073.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2074.         IMPORT_CFM_FUNCTION AutoEmbedControl
  2075.     ENDIF
  2076.  
  2077. ;
  2078. ; pascal OSErr GetSuperControl(ControlHandle inControl, ControlHandle *outParent)
  2079. ;
  2080.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2081.         Macro
  2082.         _GetSuperControl
  2083.             move.w              #$0015,D0
  2084.             dc.w                $AA73
  2085.         EndM
  2086.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2087.         IMPORT_CFM_FUNCTION GetSuperControl
  2088.     ENDIF
  2089.  
  2090. ;
  2091. ; pascal OSErr CountSubControls(ControlHandle inControl, UInt16 *outNumChildren)
  2092. ;
  2093.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2094.         Macro
  2095.         _CountSubControls
  2096.             move.w              #$0016,D0
  2097.             dc.w                $AA73
  2098.         EndM
  2099.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2100.         IMPORT_CFM_FUNCTION CountSubControls
  2101.     ENDIF
  2102.  
  2103. ;
  2104. ; pascal OSErr GetIndexedSubControl(ControlHandle inControl, UInt16 inIndex, ControlHandle *outSubControl)
  2105. ;
  2106.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2107.         Macro
  2108.         _GetIndexedSubControl
  2109.             move.w              #$0017,D0
  2110.             dc.w                $AA73
  2111.         EndM
  2112.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2113.         IMPORT_CFM_FUNCTION GetIndexedSubControl
  2114.     ENDIF
  2115.  
  2116. ;
  2117. ; pascal OSErr SetControlSupervisor(ControlHandle inControl, ControlHandle inBoss)
  2118. ;
  2119.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2120.         Macro
  2121.         _SetControlSupervisor
  2122.             move.w              #$001A,D0
  2123.             dc.w                $AA73
  2124.         EndM
  2125.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2126.         IMPORT_CFM_FUNCTION SetControlSupervisor
  2127.     ENDIF
  2128.  
  2129.  
  2130.  
  2131. ; ——————————————————————————————————————————————————————————————————————————————————————
  2132. ;     • Keyboard Focus (available only with Appearance 1.0 and later)                        
  2133. ; ——————————————————————————————————————————————————————————————————————————————————————
  2134. ;
  2135. ; pascal OSErr GetKeyboardFocus(WindowPtr inWindow, ControlHandle *outControl)
  2136. ;
  2137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2138.         Macro
  2139.         _GetKeyboardFocus
  2140.             move.w              #$000D,D0
  2141.             dc.w                $AA73
  2142.         EndM
  2143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2144.         IMPORT_CFM_FUNCTION GetKeyboardFocus
  2145.     ENDIF
  2146.  
  2147. ;
  2148. ; pascal OSErr SetKeyboardFocus(WindowPtr inWindow, ControlHandle inControl, ControlFocusPart inPart)
  2149. ;
  2150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2151.         Macro
  2152.         _SetKeyboardFocus
  2153.             move.w              #$000E,D0
  2154.             dc.w                $AA73
  2155.         EndM
  2156.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2157.         IMPORT_CFM_FUNCTION SetKeyboardFocus
  2158.     ENDIF
  2159.  
  2160. ;
  2161. ; pascal OSErr AdvanceKeyboardFocus(WindowPtr inWindow)
  2162. ;
  2163.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2164.         Macro
  2165.         _AdvanceKeyboardFocus
  2166.             move.w              #$000F,D0
  2167.             dc.w                $AA73
  2168.         EndM
  2169.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2170.         IMPORT_CFM_FUNCTION AdvanceKeyboardFocus
  2171.     ENDIF
  2172.  
  2173. ;
  2174. ; pascal OSErr ReverseKeyboardFocus(WindowPtr inWindow)
  2175. ;
  2176.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2177.         Macro
  2178.         _ReverseKeyboardFocus
  2179.             move.w              #$0010,D0
  2180.             dc.w                $AA73
  2181.         EndM
  2182.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2183.         IMPORT_CFM_FUNCTION ReverseKeyboardFocus
  2184.     ENDIF
  2185.  
  2186. ;
  2187. ; pascal OSErr ClearKeyboardFocus(WindowPtr inWindow)
  2188. ;
  2189.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2190.         Macro
  2191.         _ClearKeyboardFocus
  2192.             move.w              #$0019,D0
  2193.             dc.w                $AA73
  2194.         EndM
  2195.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2196.         IMPORT_CFM_FUNCTION ClearKeyboardFocus
  2197.     ENDIF
  2198.  
  2199.  
  2200.  
  2201. ; ——————————————————————————————————————————————————————————————————————————————————————
  2202. ;     • Control Data (available only with Appearance 1.0 and later)                        
  2203. ; ——————————————————————————————————————————————————————————————————————————————————————
  2204.  
  2205. ;
  2206. ; pascal OSErr GetControlFeatures(ControlHandle inControl, UInt32 *outFeatures)
  2207. ;
  2208.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2209.         Macro
  2210.         _GetControlFeatures
  2211.             move.w              #$0011,D0
  2212.             dc.w                $AA73
  2213.         EndM
  2214.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2215.         IMPORT_CFM_FUNCTION GetControlFeatures
  2216.     ENDIF
  2217.  
  2218. ;
  2219. ; pascal OSErr SetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inSize, Ptr inData)
  2220. ;
  2221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2222.         Macro
  2223.         _SetControlData
  2224.             move.w              #$0012,D0
  2225.             dc.w                $AA73
  2226.         EndM
  2227.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2228.         IMPORT_CFM_FUNCTION SetControlData
  2229.     ENDIF
  2230.  
  2231. ;
  2232. ; pascal OSErr GetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inBufferSize, Ptr inBuffer, Size *outActualSize)
  2233. ;
  2234.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2235.         Macro
  2236.         _GetControlData
  2237.             move.w              #$0013,D0
  2238.             dc.w                $AA73
  2239.         EndM
  2240.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2241.         IMPORT_CFM_FUNCTION GetControlData
  2242.     ENDIF
  2243.  
  2244. ;
  2245. ; pascal OSErr GetControlDataSize(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size *outMaxSize)
  2246. ;
  2247.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2248.         Macro
  2249.         _GetControlDataSize
  2250.             move.w              #$0014,D0
  2251.             dc.w                $AA73
  2252.         EndM
  2253.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2254.         IMPORT_CFM_FUNCTION GetControlDataSize
  2255.     ENDIF
  2256.  
  2257.  
  2258.  
  2259.  
  2260. ; ——————————————————————————————————————————————————————————————————————————————————————
  2261. ;     • ‘CDEF’ messages                                                                    
  2262. ; ——————————————————————————————————————————————————————————————————————————————————————
  2263. ; typedef SInt16                         ControlDefProcMessage
  2264.  
  2265.  
  2266. drawCntl                        EQU        0
  2267. testCntl                        EQU        1
  2268. calcCRgns                        EQU        2
  2269. initCntl                        EQU        3
  2270. dispCntl                        EQU        4
  2271. posCntl                            EQU        5
  2272. thumbCntl                        EQU        6
  2273. dragCntl                        EQU        7
  2274. autoTrack                        EQU        8
  2275. calcCntlRgn                        EQU        10
  2276. calcThumbRgn                    EQU        11
  2277. drawThumbOutline                EQU        12
  2278. ; ——————————————————————————————————————————————————————————————————————————————————————
  2279. ;     • ‘CDEF’ entrypoint                                                                    
  2280. ; ——————————————————————————————————————————————————————————————————————————————————————
  2281. ; ——————————————————————————————————————————————————————————————————————————————————————
  2282. ;     • Constants for drawCntl message (passed in param)                                    
  2283. ; ——————————————————————————————————————————————————————————————————————————————————————
  2284.  
  2285. kDrawControlEntireControl        EQU        0
  2286. kDrawControlIndicatorOnly        EQU        129
  2287. ; ——————————————————————————————————————————————————————————————————————————————————————
  2288. ;     • Constants for dragCntl message (passed in param)                                    
  2289. ; ——————————————————————————————————————————————————————————————————————————————————————
  2290.  
  2291. kDragControlEntireControl        EQU        0
  2292. kDragControlIndicator            EQU        1
  2293. ; ——————————————————————————————————————————————————————————————————————————————————————
  2294. ;     • Drag Constraint Structure for thumbCntl message (passed in param)                    
  2295. ; ——————————————————————————————————————————————————————————————————————————————————————
  2296. IndicatorDragConstraint    RECORD 0
  2297. limitRect                 ds        Rect            ; offset: $0 (0)
  2298. slopRect                 ds        Rect            ; offset: $8 (8)
  2299. axis                     ds.w    1                ; offset: $10 (16)
  2300. sizeof                     EQU *                    ; size:   $12 (18)
  2301.                         ENDR
  2302. ; typedef struct IndicatorDragConstraint * IndicatorDragConstraintPtr
  2303.  
  2304. ; typedef IndicatorDragConstraintPtr *    IndicatorDragConstraintHandle
  2305.  
  2306.     IF ¬ TARGET_OS_MAC THEN
  2307. ; ——————————————————————————————————————————————————————————————————————————————————————
  2308. ;     • QuickTime 3.0 Win32/unix notification    mechanism                                    
  2309. ; ——————————————————————————————————————————————————————————————————————————————————————
  2310. ;  Proc used to notify window that something happened to the control
  2311.  
  2312. ;   Proc used to prefilter events before handled by control.  A client of a control calls
  2313. ;   CTRLSetPreFilterProc() to have the control call this proc before handling the event.
  2314. ;   If the proc returns TRUE, the control can go ahead and handle the event.
  2315.  
  2316.  
  2317. ;
  2318. ; extern long GetControlComponentInstance(ControlHandle theControl)
  2319. ;
  2320.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2321.         IMPORT_CFM_FUNCTION GetControlComponentInstance
  2322.     ENDIF
  2323.  
  2324. ;
  2325. ; extern ControlHandle GetControlHandleFromCookie(long cookie)
  2326. ;
  2327.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2328.         IMPORT_CFM_FUNCTION GetControlHandleFromCookie
  2329.     ENDIF
  2330.  
  2331. ;
  2332. ; extern void SetControlDefProc(short resID, ControlDefProcPtr proc)
  2333. ;
  2334.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2335.         IMPORT_CFM_FUNCTION SetControlDefProc
  2336.     ENDIF
  2337.  
  2338.     ENDIF
  2339.     IF OLDROUTINENAMES THEN
  2340. ; ——————————————————————————————————————————————————————————————————————————————————————
  2341. ;     • OLDROUTINENAMES                                                                    
  2342. ; ——————————————————————————————————————————————————————————————————————————————————————
  2343. ;  Variants applicable to all controls (at least ones with text)
  2344.  
  2345. useWFont                        EQU        $08
  2346.  
  2347. inLabel                            EQU        1
  2348. inMenu                            EQU        2
  2349. inTriangle                        EQU        4
  2350. inButton                        EQU        10
  2351. inCheckBox                        EQU        11
  2352. inUpButton                        EQU        20
  2353. inDownButton                    EQU        21
  2354. inPageUp                        EQU        22
  2355. inPageDown                        EQU        23
  2356. inThumb                            EQU        129
  2357.  
  2358. kNoHiliteControlPart            EQU        0
  2359. kInLabelControlPart                EQU        1
  2360. kInMenuControlPart                EQU        2
  2361. kInTriangleControlPart            EQU        4
  2362. kInButtonControlPart            EQU        10
  2363. kInCheckBoxControlPart            EQU        11
  2364. kInUpButtonControlPart            EQU        20
  2365. kInDownButtonControlPart        EQU        21
  2366. kInPageUpControlPart            EQU        22
  2367. kInPageDownControlPart            EQU        23
  2368. kInIndicatorControlPart            EQU        129
  2369. kReservedControlPart            EQU        254
  2370. kControlInactiveControlPart        EQU        255
  2371.     ENDIF    ; OLDROUTINENAMES
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.     ENDIF ; __CONTROLS__ 
  2379.  
  2380.